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
This works fine, but is a bit repetitive and requires the use of an effect in user-land code.
This would potentially make this a first class method on the Store, such as:
store.dispatch(()=>Actions.myAction(this.id()));
This would listen for changes to the signal(s) and run the dispatch callback. It would also be run in the correct injection context using logic similar to the PR below, so it's cleaned up correctly when used at the component level even though the Store is a root provider.
Which @ngrx/* package(s) are relevant/related to the feature request?
store
Information
Had a discussion started by @manfredsteyer on using an effect to dispatch actions. Straightforward example.
This works fine, but is a bit repetitive and requires the use of an
effect
in user-land code.This would potentially make this a first class method on the Store, such as:
This would listen for changes to the signal(s) and run the dispatch callback. It would also be run in the correct injection context using logic similar to the PR below, so it's cleaned up correctly when used at the component level even though the Store is a root provider.
#4529
This would also encourage less use of
effect
in user-land code for this use case.Describe any alternatives/workarounds you're currently using
Use a Signal Store in the component as a proxy between the component and global Store.
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: