-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
This is the original (potential) issue I wanted to report:
When, within the same 'tick', you change a value and then change it again, but back to the original value, the updated cortex does not register that last change.
let cortex = new Cortex({a: 1}, cortex => {
// the new cortex here will contain {a: 2} after the script finishes
});
cortex.a.set(2);
cortex.a.set(1);To clarify: this only happens when your last call to set (within the same tick) contains the original value (the value your cortex had at the start of the tick). Cortex compares them and sees no change, so decides no update is necessary if I understood right.
PR with failing test coming up.
Feel free to ignore if this is by design. It just felt awkward when I bumped into this issue.
I now fixed it by calling the second set inside a setTimeout.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels