Hacker News new | past | comments | ask | show | jobs | submit login
Launch.io – Simple, Fast, Time Traveling React State Management (jbillmann.com)
2 points by jbillmann on Feb 16, 2021 | hide | past | favorite | 3 comments



A global initializeLaunch is a deal breaker.

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


Thanks for the feedback! As noted in my blog post, these types of tradeoffs were consciously made to simplify other aspects React state management. If, for example, sub-stores and/or parallel stores are important, Launch.IO might not be a good choice.


I don't see this as a large tradeoff. Taking from your example and modifying to follow good practices:

    const launch = initializeLaunch(/* ... */);
    
    const App = () => {
      // ...
    
      return (
        <LaunchProvider launch={launch}>
          <div>...</div>
        </LaunchProvider>
      );
    };




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: