mobx-state-tree
mobx-state-tree copied to clipboard
RootStore type becomes "any" the moment we call a RootStore model action using yield on a child model action
Bug report
- [x] I've checked documentation and searched for existing issues
- [x] I've made sure my project is based on the latest MST version
- [x] Fork this code sandbox or another minimal reproduction.
Sandbox link or minimal reproduction code Here is the repro
Describe the expected behavior The typings should not become any and there shouldn't be any circular reference error.
Describe the observed behavior
The problem starts when using yield
with a RootStore action within a child model. I do not have a problem getting the RootStore or even executing it's actions, it just happens when using yield
with an async function. See line 13, 14 and 15 of the RootStore.ts
file.