harryhope / hooked-on-redux Goto Github PK
View Code? Open in Web Editor NEW๐ฃ โ๏ธ Use redux through state hooks
Home Page: https://hooked-on-redux.js.org/
License: MIT License
๐ฃ โ๏ธ Use redux through state hooks
Home Page: https://hooked-on-redux.js.org/
License: MIT License
First off congratulations on such an amazing and clean take on hooks use in redux.
I think that for this library (or documentation) is missing 2 use cases for it to be used in a real-world project.
There are other ways of doing this in Redux, but I was wondering about the best way to solve this problem in a "best-practice" with this library
As I have been trying to integrate hooked-on-redux in an existing project that contains multiple reducers there has been an issue that the getter and setter are working differently.
To be able to retrieve the value correctly I have to include the name of the reducer. However, this breaks the second part of the touple. To get the correct behavior there has to be something like this:
const [loading] = useHookedOnState('flamingo.loading', true);
const [, loading] = useHookedOnState('loading', true);
This is not even a possible solution because if the default state is an {}
then redux gets into an infinite loop.
Awesome work and I think I have been waiting for something like this without realizing
Though why useHookedOn...
and hooked-on-redux
?
why not names like redux-hooks
and useReduxState
?
Just wanna understand the naming bit better. Thanks ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.