loading...

re: Introducing Object Hooks: Mutable State for React 🤯 VIEW POST

FULL DISCUSSION
 

Hey Ryan!

Someone else posted a link to the GitHub repository yesterday and I quickly took a look on it! Seems very interesting! I also had some thoughts about a resettable state and published my code :D

github.com/YannickFricke/react-res...

Feel free to leave any comments! :)

 

I like it! I use a similar pattern in object hooks!

 

To be honest, I was inspired by your library! :)

A great library would be so inspiring and accessible that you could and would want to adapt parts of it or ideas from it for your own use. I'm happy it resonated with you, and you were able to pick up on the pattern and adapt it!

I just wanted this single part only without all the other stuff you have in your code.

KISS - Keep It Stupid Simple

Someone could argue that relying on to much dependencies makes the technical debt bigger and bigger. But this is so simple, you could even write it yourself :D

Thanks again for the idea! :)

The extra bit that bridges the diff between resettable state, and mutable state: is taking the setState function and calling it whenever properties on the object change. If that's not a feature you want though, then resettable state is a good solution!

Code of Conduct Report abuse