Routing results for different effect arguments to different stores. #809
Unanswered
KenjiTakahashi
asked this question in
Q&A
Replies: 1 comment 4 replies
-
If I get it, you can use condition({
source: merge(e.done, e.fail),
filter: ({ params }) => params.arg === 1,
then: s1,
else: s2,
})
e({ arg: 1 })
e({ arg: 2 })
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Consider a following (simplified) structure: https://share.effector.dev/iCXzsmD8.
Now, how would I go about if I wanted the result of effect call for
{arg:1}
to go only tos1
and for{arg:2}
only tos2
?I'm not sure how to achieve this in a "clean" way.
What I could think of is:
sample
(or sth else?) (why gather all output in one place only to split it apart again?).Both would also require doing object comparisons in JS, which is a bit PITA.
The real life case is having multiple, separate instances of a component, where each instance expects data for different arguments.
Appreciate any insights!
Beta Was this translation helpful? Give feedback.
All reactions