Turn replayer must preserve currentFacet, else actions run in the wrong context

This commit is contained in:
Tony Garnock-Jones 2019-06-07 14:20:45 +01:00
parent 5ecadc8acb
commit dc7ee60517
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
"use strict";
import { _Dataspace, currentFacet } from "@syndicate-lang/core";
import { Dataspace, _Dataspace, currentFacet } from "@syndicate-lang/core";
const PRIORITY = _Dataspace.PRIORITY;
export function recorder(fields, fieldName, callbacks) {
@ -24,7 +24,7 @@ export function replayer(callbacks0) {
return {
worklist: [],
extend: function (thunk) {
this.worklist.push(thunk);
this.worklist.push(Dataspace.wrap(thunk));
},
commit: function () {
this.worklist.forEach((thunk) => thunk());