Settings

Theme

Show HN: List of React state management tools

github.com

4 points by grassfedcode 8 years ago · 3 comments

Reader

dvddgld 8 years ago

MobX has been great to me on small projects, but I’ve heard the magic can lead to problems down the road. Has anyone ran into these problems?

I’ve also noticed some of the noteworthy React guys have been turning away from redux lately. I guess nowhere is safe haha. What’s everyone here using at the moment?

  • grassfedcodeOP 8 years ago

    I've been using Stator[0] which uses a global JavaScript object with get(), set(), and connectComponentState() methods that selectively call setState() on components that connect to the global state.

    It has worked really well for me on a 5k+ LOC frontend to gdb called gdbgui[1]. It's performant, but perhaps more importantly, it matches my mental model of how the code works (essentially a global setState, can log changes to the console, do type checking, etc.) so I can work more efficiently. Stator was originally part of gdbgui, but since the pattern worked so well for me I extracted it into its own library.

    [0] https://github.com/cs01/stator

    [1] https://github.com/cs01/gdbgui

    • dvddgld 8 years ago

      I like this approach, going to try it out! Thanks for sharing and for releasing good open source software (gdbgui looks great)!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection