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
There's this case where I have an array of contacts in one store, and an array of ids in another store (selected contacts). Then there's a third store that merges the two, adding isSelected to the contacts whose id exists in the second store.
Now with joins, this becomes trivial. However, joins require all event sources to fire before firing the handler. If I only changed the second store, it won't fire the join on the third store. The effect is that views depending on the third store will not update because the first store didn't update anything yet.
Is there a way to fire the handler when any of the event sources trigger? I once did this by manually listening to changes, caching the data, and firing a remapper function. But it would be nice if this was baked into Reflux.
Yeah, I've been doing this manually as well. I don't know if joins is the right pattern for this since it will yield undefined/null values. Maybe there is a better pattern for this? I'd love (:heart:) to hear other ideas for this "remapping" use case.
I just implemented Reflux.waitFor() which is available in reflux-waitfor npm package.
This way, the store will be listening to the action directly (instead of listening to other stores). Now, in your store’s action handler, it can ask Reflux that the action be delivered to some other store (synchronously) first.
Hope you (or anyone who stumbles upon this issue) find it useful!
Activity
spoike commentedon Dec 17, 2014
Yeah, I've been doing this manually as well. I don't know if joins is the right pattern for this since it will yield undefined/null values. Maybe there is a better pattern for this? I'd love (:heart:) to hear other ideas for this "remapping" use case.
gabadi commentedon Jan 11, 2015
Can't be a joinCombine?
like baconjs combine: https://github.com/baconjs/bacon.js/wiki/Diagrams
and like was proposed in this post: #55
That could be really useful
gabadi commentedon Jan 12, 2015
I need the feature and i can try to make a pull request, but i need to know if that would be ok
spoike commentedon Jan 13, 2015
@gabadi It's OK. 👍
gabadi commentedon Jan 25, 2015
till now i didn't arrive to something that is good enough. If i've something i'll do a pull request
dtinth commentedon Dec 19, 2015
I just implemented
Reflux.waitFor()which is available inreflux-waitfornpm package.This way, the store will be listening to the action directly (instead of listening to other stores). Now, in your store’s action handler, it can ask Reflux that the action be delivered to some other store (synchronously) first.
Hope you (or anyone who stumbles upon this issue) find it useful!
nidu commentedon Jan 12, 2016
So is this one abandoned? What solution did you choose? Just introduced baconjs into the application?