Closed greeksolid closed 5 years ago
I don't know how MST wraps actions, but mobx-task works by creating a new function and tacking on the state observables. If MST wraps it in another function, that state is lost. This is why task().wrap(fn => yourWrapper(fn))
exists. task().bind()
is also automatically wrapped for you.
Yes it seems I have to learn/understand how MST wraps actions to make it work with task. (I am very new to MST). I tried to use task().wrap around the action before exporting it but got an error so I thought I ask here in hopes that you have worked with MST before. 😃 Thanks a lot for your time, really appreciate it.
I am trying to use mobx-task to wrap a mobx-state-tree action with mobx-task like this :
But when I try to access the task status from within a component I get undefined?
Has anyone tried something similar? I would really love to avoid all the boilerplate of tracking the promise state manually if possible