New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dispatch-later
doesn't allow dispatch-n
#554
Comments
There’s a large number of possible APIs that could go into re-frame. dispatch-later is generally pretty niche and already supports multiple dispatches. I’m not sure if there would be enough usage to have a separate dispatch-n-later API? You could always write this effect handler yourself, or write a function which created the dispatch-later style effect, but you give it a list of events, and a time. Maybe there are other use-cases I’m not thinking of though? |
It was just surprising that |
This reads like a slight miscommunication to me, I read the original issue as wanting to be able to use something like
If I'm correct, here's a new effect that should cover that use case.
Happy to make a PR if this is a desirable change to the built in |
@danielcompton’s earlier comment correctly explains that there are many possible effects or combinations of effects. The standard ones don’t try to cover every case. Instead, they are intended to handle the common cases and their implementation shows how easy it is for you to create your own. If your needs are slightly more exotic, I would suggest writing your own effect handler. Such effect handlers can typically be achieved in, maybe, 10 lines of code, and your custom version would provide you with exactly the combination of features you need. Closing. |
Seems like non-idiomatic to have
dispatch-n
for multiple event dispatches, but not allow it in adispatch-later
. Instead, it's a vector of multiple maps that can each have their own millisecond delays: https://github.com/Day8/re-frame/blob/master/docs/API.md#built-in-effect-handlersThe text was updated successfully, but these errors were encountered: