Launch.io – Simple, Fast, Time Traveling React State Management
jbillmann.com
jbillmann.com
Services should be passed a provider (similar to Redux). Having state stored globally can cause many issues:
- Testing is harder, as the state can be shared
- Having sub-stores is impossible
- Having parallel stores is impossible
const launch = initializeLaunch(/* ... */);
const App = () => {
// ...
return (
<LaunchProvider launch={launch}>
<div>...</div>
</LaunchProvider>
);
};