Replies: 1 comment 2 replies
-
Hey @baeharam - I know this is a bit of an old thread, but if you ended up coming to a conclusion here, I'd love to know:
Thanks! |
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
-
MST is great, but when I use
flow()
to fetch some server data, two things are duplicated over whole codebase.PENDING
,SUCCESS
,FAILURE
. Someone usesisLoading
and someone usesisPending
so it doesn't have consistency and has duplication.flow()
function. It's verbose.To solve this, I thought that extracting "fetcher" model could be solution for this problem. ⬇️ It is my implementation.
This is "fetcher" model which handles only fetching logic. It solves duplication and race condition. From this context, I have to define "buisness" model which handles buisness logic(transformation of server data, etc). So I'd like to use "fetcher" model with "business" model like below. (pseudo code)
Is there a good way to implement like above? I looked for
extend
andcompose
but I think it doesn't fit this kind of implementation. Thanks for your reading 🙇♂️Beta Was this translation helpful? Give feedback.
All reactions