Queue prop subscriptions to be called in one time-slice #1

Open
opened 2020-08-26 07:58:36 -05:00 by explorigin · 0 comments
Owner

Currently evaluations happen asyncronously but in a bit of a wierd way:

  • if a prop changes, subscribers are called.
  • if a prop changes inside a called subscriber, the new prop change is delayed until after all subscribers are called (but within the same time-slice).

This can still cause an infiniloop (though the code would be of poor design).

To fix this, subscribable._fire should queue returned callables as microtasks (https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide). This way several props can be updated before subscriptions are processed

Currently evaluations happen asyncronously but in a bit of a wierd way: - if a prop changes, subscribers are called. - if a prop changes inside a called subscriber, the new prop change is delayed until after all subscribers are called (but within the same time-slice). This can still cause an infiniloop (though the code would be of poor design). To fix this, `subscribable._fire` should queue returned callables as microtasks (https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide). This way several props can be updated before subscriptions are processed
This repo is archived. You cannot comment on issues.
No Label
No Milestone
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: explorigin/reactimal#1
No description provided.