Reactions
#886
Replies: 1 comment
-
Well, that existed a few years ago, and where called subscriptions. But then Shawn decided to do it even easier, and you can listen executions of another's reducers/effects from another models. https://github.com/rematch/rematch/tree/master/plugins/subscriptions Probably this should work for you, if not of course we're open to contributions submitting new plugins and making Rematch ecosystem even better =) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm looking into Rematch 2 for enterprise applications and there is one feature I'm messing: reactions. Oftentimes there are cases when a model depends on a change in another model and really needs to observe it.
Here is an example: our managers are working with timed operations, let say deals. When a manager requests deal confirmation from the server, that confirmation is valid for a limited amount of time. The problem is, managers often work on several deals at a time, and would like to have a sound notification whenever a deal has less than 5 minutes left.
Our store has a
clock
model, which containscurrentDate
property. That property is updated via a reducer called from asetInterval
, so for our system the date moves forward in ticks of 1 second. A lot of models depend on theclock
model, so there is no way for it know about every one of their reducers / effects, those models have to observe theclock
.The way I see it, I'd like to have something like this in my models:
I have an idea how to implement this via 'store.subscribe' and a plugin, but I was wondering, since such reactions are required quite often, maybe it would make sense to introduce them into Rematch itself?
Beta Was this translation helpful? Give feedback.
All reactions