Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling store.dispatch in sequence will only set the new state once #1871

Open
gtroxler opened this issue Jan 9, 2024 · 0 comments
Open

Comments

@gtroxler
Copy link

gtroxler commented Jan 9, 2024

When store.dispatch is queuing multiple dispatch requests it seems that only the first dispatch requests results in setting the new value. Then afterDispatch is called for the each of the queued dispatch events which seems never to call _setState.

How to reproduce, build a page which dispatches multiple actions which call a rest api, subscribe to state changes and observe that only the first one will published.

Assumption every store.dispatch call that changes the state will be published to subscribers.

Code in question: https://github.com/aurelia/aurelia/blob/master/packages/state/src/store.ts
Function: dispatch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants