Hacker News new | ask | show | jobs
by gunn 2367 days ago
Here's the library I wrote to replace redux for myself: https://github.com/gunn/pure-store

It's the simplest API I could think of, has excellent type support, and handles immutability for you.

3 comments

Thank you for pure-store, I'm surprised it hasn't attracted more attention!

The API is perfectly small and straight-forward, it's close to the ideal I imagine.

For a few years I've been using a similarly tiny library I wrote to reduce Redux's verbosity, but I may migrate to pure-store as it's even smaller and gets to the essence of state management.

Seeing the popularity of React hooks and Redux+friends, I know I'm in the minority of people who lament the direction they're going. I'm secretly hoping for a "destructuring" of the React ecosystem into more generic concepts/libraries/modules that work with or without React, carrying on the lessons learned but implemented as simple and independent as possible.

To me, pure-store (and immer for sure) is one of those libraries that point the way to a better future.

Looks very similar to Undux! https://undux.org/

Then again, who hasn’t built a state management framework for React?

Nice. My take on the simplest possible API:

https://github.com/will123195/venti