Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(emitter): flush remaining effects queue on state update
Previously, if a state update arrived while an effects queue was in the middle of being processed, the active effects queue was simply discarded and the new one processed. This was potentially buggy in that `onEnd` callbacks might not be called even if the `onStart` was (and similar clean-up bugs if relying on a separate effect or `effects:end` to run clean-up, stop animations etc.). Now, any outstanding effects are flushed when a new state update arrives, ensuring those callbacks will all immediately be called before the new queue is started. BREAKING CHANGE: This may be a breaking change if you were relying on the previous queue being discarded. Given that would be highly timing dependent between when moves where executed, that seems unlikely to be the case, but flagging this as potentially breaking nonetheless. Closes #57
- Loading branch information