Add `effectOn` API
See original GitHub issueSo I was trying to figure out a way to centralize an effect based on when a specific part of a model changes. This should cover when it loads from default to persisted value. The idea would be something like:
const storeModel = persist({
token: '',
setToken: action((state, payload) => ({ ...state, token: payload })),
onTokenChange: effectOn(state => state.token, async () => {
// fetch user data and dispatch actions.
})
})
This would allow us to fetch user data when token is changed from anywhere, whether it be from an action, or from the initial load from the persisted store.
The specific api isn’t important, but I think this mechanism could allow much easier centralization of logic.
What do ya’ll think?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:18 (8 by maintainers)
Top Results From Across the Web
.effect() | jQuery UI API Documentation
Description: Apply an animation effect to an element. ... A string indicating which effect to use for the transition. options. Type: Object.
Read more >How to add effects to audio - web.dev
Learn how to use the Web Audio API to add effects to audio sources. ... Next, create an effect node using createBiquadFilter() ....
Read more >Effect API | Banuba SDK v1.5.3
The Effect API comes as part of Face AR SDK and allows you to use the built-in effects in your app. Instead of...
Read more >36. Adding Post Data by making Http Post API call ... - YouTube
Hi FriendsIn this video we will see how to add posts by making the backend http post api call using effects in Ngrx...
Read more >Applying Special Effects to Multiple Tokens: A Roll20 API ...
This video shows how to write a script that will apply a special effect to multiple selected tokens. Note that this does require...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Great! Yep, plugin architecture is still on the way. I did a trial run on another branch, but will apply it to 3.4.0 soon. Will ping you when it is ready.
@paul-sachs the code, tests and TS typings are complete. 👍
I just need to write docs then will release into alpha.