@omegup/msync 0.0.39 → 0.0.40
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 +4 -4
- package/index.js +4 -4
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1139,8 +1139,8 @@ const race = (sources) => {
|
|
|
1139
1139
|
const nextWinner = (previousWinner, previousWinnerNextFrame, sources, interrupt) => {
|
|
1140
1140
|
const { frame: previousFrame, key } = previousWinner;
|
|
1141
1141
|
if (!interrupt?.(key) && previousFrame.info.job) {
|
|
1142
|
-
return previousWinnerNextFrame.then(
|
|
1143
|
-
if (previousFrameSuccessor.info.job) {
|
|
1142
|
+
return previousWinnerNextFrame.then(previousFrameSuccessor => {
|
|
1143
|
+
if (previousFrame.info.job === previousFrameSuccessor.info.job) {
|
|
1144
1144
|
return { frame: previousFrameSuccessor, key };
|
|
1145
1145
|
}
|
|
1146
1146
|
return race(sources);
|
|
@@ -1206,7 +1206,7 @@ class Machine {
|
|
|
1206
1206
|
return runCont(run, cb);
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
|
-
const wrap = (root) => root;
|
|
1209
|
+
const wrap = (root) => new Machine(root.runner());
|
|
1210
1210
|
const runCont = async (it, cb) => {
|
|
1211
1211
|
const { next, stop, clear } = it();
|
|
1212
1212
|
const res = await next.then(next => ({ ok: true, next }), err => ({ ok: false, err }));
|
|
@@ -1626,7 +1626,7 @@ const executes$1 = (view, input, streamName) => {
|
|
|
1626
1626
|
const step8 = (l) => {
|
|
1627
1627
|
return nextData(l.aggResult.cursor.firstBatch)(() => l.stream
|
|
1628
1628
|
.tryNext()
|
|
1629
|
-
.catch(
|
|
1629
|
+
.catch(err => { log('restarting', err); return 1; })
|
|
1630
1630
|
.then(doc => (doc ? next(step2, 'restart') : step8(l))), 'wait for change');
|
|
1631
1631
|
};
|
|
1632
1632
|
return stop;
|
package/index.js
CHANGED
|
@@ -1141,8 +1141,8 @@ const race = (sources) => {
|
|
|
1141
1141
|
const nextWinner = (previousWinner, previousWinnerNextFrame, sources, interrupt) => {
|
|
1142
1142
|
const { frame: previousFrame, key } = previousWinner;
|
|
1143
1143
|
if (!interrupt?.(key) && previousFrame.info.job) {
|
|
1144
|
-
return previousWinnerNextFrame.then(
|
|
1145
|
-
if (previousFrameSuccessor.info.job) {
|
|
1144
|
+
return previousWinnerNextFrame.then(previousFrameSuccessor => {
|
|
1145
|
+
if (previousFrame.info.job === previousFrameSuccessor.info.job) {
|
|
1146
1146
|
return { frame: previousFrameSuccessor, key };
|
|
1147
1147
|
}
|
|
1148
1148
|
return race(sources);
|
|
@@ -1208,7 +1208,7 @@ class Machine {
|
|
|
1208
1208
|
return runCont(run, cb);
|
|
1209
1209
|
}
|
|
1210
1210
|
}
|
|
1211
|
-
const wrap = (root) => root;
|
|
1211
|
+
const wrap = (root) => new Machine(root.runner());
|
|
1212
1212
|
const runCont = async (it, cb) => {
|
|
1213
1213
|
const { next, stop, clear } = it();
|
|
1214
1214
|
const res = await next.then(next => ({ ok: true, next }), err => ({ ok: false, err }));
|
|
@@ -1628,7 +1628,7 @@ const executes$1 = (view, input, streamName) => {
|
|
|
1628
1628
|
const step8 = (l) => {
|
|
1629
1629
|
return nextData(l.aggResult.cursor.firstBatch)(() => l.stream
|
|
1630
1630
|
.tryNext()
|
|
1631
|
-
.catch(
|
|
1631
|
+
.catch(err => { log('restarting', err); return 1; })
|
|
1632
1632
|
.then(doc => (doc ? next(step2, 'restart') : step8(l))), 'wait for change');
|
|
1633
1633
|
};
|
|
1634
1634
|
return stop;
|