@omegup/msync 0.0.35 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +3 -4
- package/index.js +3 -4
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -951,15 +951,14 @@ class Machine {
|
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
const wrap = (root) => root;
|
|
954
|
-
const runCont = async ({ next }, cb) => {
|
|
954
|
+
const runCont = async ({ next, clear }, cb) => {
|
|
955
955
|
const { cont, info } = await next;
|
|
956
956
|
const stopped = cb?.(info);
|
|
957
|
-
const it = cont();
|
|
958
957
|
if (stopped) {
|
|
959
|
-
await
|
|
958
|
+
await clear();
|
|
960
959
|
throw new Error('Machine stopped');
|
|
961
960
|
}
|
|
962
|
-
return runCont(
|
|
961
|
+
return runCont(cont(), cb);
|
|
963
962
|
};
|
|
964
963
|
|
|
965
964
|
const merge = ({ lsource: L, rsource: R, }) => mergeIterators({ sources: { L, R } });
|
package/index.js
CHANGED
|
@@ -953,15 +953,14 @@ class Machine {
|
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
const wrap = (root) => root;
|
|
956
|
-
const runCont = async ({ next }, cb) => {
|
|
956
|
+
const runCont = async ({ next, clear }, cb) => {
|
|
957
957
|
const { cont, info } = await next;
|
|
958
958
|
const stopped = cb?.(info);
|
|
959
|
-
const it = cont();
|
|
960
959
|
if (stopped) {
|
|
961
|
-
await
|
|
960
|
+
await clear();
|
|
962
961
|
throw new Error('Machine stopped');
|
|
963
962
|
}
|
|
964
|
-
return runCont(
|
|
963
|
+
return runCont(cont(), cb);
|
|
965
964
|
};
|
|
966
965
|
|
|
967
966
|
const merge = ({ lsource: L, rsource: R, }) => mergeIterators({ sources: { L, R } });
|