{"repo":"KidkArolis/tiny-atom","free":true,"listed":false,"github":"https://github.com/KidkArolis/tiny-atom","clone":"git clone https://github.com/KidkArolis/tiny-atom.git","description":"Pragmatic state management.","language":"JavaScript","stars":116,"topics":["javascript","minimal","state","flux","functional","react","preact"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"🏄 global store for sharing application state easily ⚡️ highly optimised subscriptions and selectors ⚛️ supports React and Preact History Created in 2017, Tiny Atom aimed to offer: - A streamlined and user-friendly alternative to Redux - Compatibility with both React and Preact - Efficient re-rendering. Tiny Atom achieved enhanced efficiency through: - Tracking and deduping nested subscription updates - Re-rendering only when there's a change in the computed state selection. However, with the introduction of useSyncExternalStore , React now inherently encompasses the first two aforementioned optimizations. At the same time the global state approach has been slowly falling out of fashion in favor of using higher level state abstractions like Suspense, Relay, React Query and most recently React Server Components as well as more atomic and modular strategies such as Recoil. Although tiny-atom remains a robust and battle tested solution, it's worth considering contemporary alternatives. For instance, Zustand embodies similar global store concepts in a more modern package. Meanwhile, Kinfolk is a spiritual successor to tiny-atom offering more streamlined and powerful alternative for managing shared application state. Installation Example API createAtom(options) Create an atom. Options: state The initial state of the atom. Default: {} . actions An object with action functions. Where every action is (params, payload) = void with params: - get() - get the current state - set(patch) -","default_branch":null,"files":null,"tree":[],"storefront":"/r/KidkArolis","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/KidkArolis/tiny-atom/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}