How do I trigger re-frame/reg-fx
with this library?
#36
Unanswered
Invertisment
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm new to re-frame and I want to control a pipeline of promises.
I think this library allows to do it but it requires to register EVent handlers for each action and I want to use EFfects.
I think that using EFfects is better as they don't mutate the application state and instead trigger EFfects which I'd like to listen to.
The tutorial of re-frame tells that EFfects are what should be used mutations (outside world, data fetching, etc.) and EVents (the ones who are triggered via
dispatch
) should be used to process user's callbacks and change application's state.This is the doc: https://day8.github.io/re-frame/Effects/.
I'd like to know what is the best way to use this library if I want to fire several consecutive EFfects which do some fetching. The original re-frame tutorial doesn't show any example which deals with execution of two consecutive requests, for instance.
I think I simply need an example because I can't think of a better way than to wrap every step of my logic into a EVent handler that requests EFfects to happen. Is this the way to do it?
(By "wrap" I mean to have an EVent that simply returns cofx that triggers one or multiple EFfects)
Beta Was this translation helpful? Give feedback.
All reactions