Allow alternate API to Dataspace.backgroundTask
This commit is contained in:
parent
9e41d8754c
commit
95f8e881d2
|
@ -113,12 +113,13 @@ Dataspace.backgroundTask = function (k) {
|
||||||
let ground = Dataspace._currentFacet.actor.dataspace.container;
|
let ground = Dataspace._currentFacet.actor.dataspace.container;
|
||||||
let active = true;
|
let active = true;
|
||||||
ground.backgroundTaskCount++;
|
ground.backgroundTaskCount++;
|
||||||
return k(() => {
|
function finish() {
|
||||||
if (active) {
|
if (active) {
|
||||||
ground.backgroundTaskCount--;
|
ground.backgroundTaskCount--;
|
||||||
active = false;
|
active = false;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
return k ? k(finish) : finish;
|
||||||
};
|
};
|
||||||
|
|
||||||
Dataspace.referenceField = function (obj, prop) {
|
Dataspace.referenceField = function (obj, prop) {
|
||||||
|
|
Loading…
Reference in New Issue