Implementing Cancelable Data Loading in React Native with Fibers
Trying to start using fibers but still confused after reading the docs
Specific use case: a React Native component that runs an Effect to load its data (using
It seems that some combination of
Specific use case: a React Native component that runs an Effect to load its data (using
Effect.runPromise within a useEffect). That of course works fine, but what I'm trying to add is a "cancel" action, i.e. if the user dismisses this component, there's no need to continue loading its data.It seems that some combination of
Effect.fork and Effect.interrupt is what I'm looking for, but I still am unclear how to comunicate between the two effects (the data task effect that runs on component load, and the cancel effect that runs on component dismiss)