You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I love undux and how easy it is to use! Thanks for creating it and maintaining it!
I just stumbled across an behavior that I felt a bit weird to me: When I subscribe to a store change via store.on('foo').subscribe(a => ...), the effect is fired not once, but lots of times: On the first change it fires once, on the second twice, on the third three times and so on. Is this intended?
Actual behavior
After a couple of store changes, each effect is fired up to hundreds of times (for 40 store changes the effects were fired 820 times)
Expected behavior
Each change should only fire an effect only once
Thanks for the hint @DeanKamali! I tried around with it, and realized that I was using the effects inside a React Component which looked it was reloaded every time the store changed.
Now I switched to using effects via export default createConnectedStore(initialState, withEffects); (https://undux.org/#quick-start/2), which I didn't see before. That works fine!
I love undux and how easy it is to use! Thanks for creating it and maintaining it!
I just stumbled across an behavior that I felt a bit weird to me: When I subscribe to a store change via
store.on('foo').subscribe(a => ...)
, the effect is fired not once, but lots of times: On the first change it fires once, on the second twice, on the third three times and so on. Is this intended?Actual behavior
After a couple of store changes, each effect is fired up to hundreds of times (for 40 store changes the effects were fired 820 times)
Expected behavior
Each change should only fire an effect only once
Steps to reproduce
Here's an example: https://codesandbox.io/s/undux-demo-forked-tmb1o?file=/src/index.js:488-563 (watch the console.log)
The text was updated successfully, but these errors were encountered: