A robust, opinionated, UI state management option for scalable and precise communication across ReactJS Components rendered on either the client-side

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2024-03-28 11:30:06

A robust, opinionated, UI state management option for scalable and precise communication across ReactJS Components rendered on either the client-side or server-side. It heavily compliments react-query (@tanstack/react-query). busser is a synchronous state manager while react-query or @tanstack/query is an asynchronous state manager. Just the same way RTK and RTK Query handle UI state and Server state respectively, busser and react-query or @tanstack/query handle UI state and Server state respectively.

This library is made up of custom ReactJS hooks that provide basic tools to build stateful web applications that scale well even as the size of UI state and data flow paths grow or ranch out in very undeterministic manners. It makes it very easy to manage not just UI state but data flow across each React components that needs to access, share or recompute state in an effiecient manner. busser achieves this by using an event bus, eliminating wasteful re-renders where necessary by employing signals and utilizing the best places to store specific kinds of UI state.

So, why create busser ? Well, after using a lot of state managers like Redux, RTK Query, Zustand and Jotai. I found that the flow of data was very restricted/contrained because state (most state if not all state) was being stored in a single place (or slices of a single place - RTK Query, Zustand). I needed state to flow to where it was needed without gates or having to bypass or workaround predetermined routes. Also, most state managers out there are built in such a way that it encourages the storage and management of both UI state and server state be handled in the different parts of the same "machine" tightly couples together.

Leave a Comment