bpms_site/.svn/pristine/3a/3a024db63df5e9b6932256477fcecebaa9797204.svn-base
2025-11-02 16:38:49 +03:30

20 lines
565 B
Plaintext

/**
* Create data fetching record for Promise.
*/ export function createRecordFromThenable(promise) {
const thenable = promise;
thenable.status = "pending";
thenable.then((value)=>{
if (thenable.status === "pending") {
thenable.status = "fulfilled";
thenable.value = value;
}
}, (err)=>{
if (thenable.status === "pending") {
thenable.status = "rejected";
thenable.reason = err;
}
});
return thenable;
}
//# sourceMappingURL=create-record-from-thenable.js.map