
RNR 175: State Management In React Native
React Native Radio
00:00
How Does MobX StateTree Handle Side Effects?
MobX StateTree uses flows which are basically fancy async functions. It lets you make a call out to an external service like an API and wait for the result. That's something we're really already used to doing in JavaScript. We use promises all the time so it's very intuitive. You can even yield for things like I'm going to wait for, there's a function called wait. And you can wait for a property in the model to change. So example, you can pop up a modal. And then when that modal closes, continue your action. You can just keep going, like in the middle of your action. It's kind of almost freaky.
Transcript
Play full episode