
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-redux-human-hooks
Advanced tools
React hooks for redux that humans can understand. Integrate redux into your React app one npm install away.
The main goal of react-redux-human-hooks is that you can integrate Redux into your app in a simple and fast way, while maintaining performance.
npm:
npm i react-redux-human-hooks
yarn:
yarn add react-redux-human-hooks
import {createAction,createActions} from 'react-redux-human-hooks';
//Define action types here
export const { setAnimal, otherAction}
= createActions('SET_ANIMAL','OTHER_ACTION')
//You can specify them one by one
export const setDog = createAction('SET_DOG');
//Or you can write your own actions creators
export const setSquanch = createAction('SET_SQUANCH',payload=>{
//do something
return 'Squanchy';
});
import {createReducer} from 'react-redux-human-hooks'
import * as actions from './actions';
const reducer = createReducer({
[actions.setAnimal]: (state, action) => ({
...state,
animal: action.payload
}),
[actions.setDog]: (state, action) => ({
...state,
animal: 'Dog'
}),
[actions.setSquanch]: (state, action) => ({
...state,
animal: 'Squanchy'
}),
},
//Initial state
{
animal: 'Cat',
}
);
export default reducer;
import React from 'react';
//We provide the necessary modules, you can also import them from redux and react-redux
import {Provider,createStore} from 'react-redux-human-hooks';
import rootReducer from './reducer';
import MyComponent from './MyComponent';
//Create the store, in this case we are using teh Redux Devtools middleware
const store = createStore(rootReducer,
window.__REDUX_DEVTOOLS_EXTENSION__ &&
window.__REDUX_DEVTOOLS_EXTENSION__());
function App() {
return (
//Note we are wrapping the entire app using Provider
<Provider store={store}>
<div className="App">
<header className="App-header">
<h1>
React Redux Human Hooks Example
</h1>
</header>
<MyComponent/>
</div>
</Provider>
);
}
export default App;
import React from 'react';
import {useReduxState,useBindActionCreators} from 'react-redux-human-hooks';
import * as actions from './actions';
function MyComponent() {
const {setDog,setAnimal,setSquanch} = useBindActionCreators(actions);
const {animal} = useReduxState(
state=>state
)
return (
<div style={{backgroundColor:'#F1F1F1',display:'flex',flexDirection:'column'}}>
<h3>Animal: {animal}</h3>
<div>
<button onClick={()=>setDog()}>Set Dog</button>
<button onClick={()=>setAnimal(Math.random()>0.5?'Cat':'Moose')}>Set Random</button>
<button onClick={()=>setSquanch()}>Set Squanch</button>
</div>
</div>
);
}
export default MyComponent;
FAQs
React-Redux hooks for human beings
The npm package react-redux-human-hooks receives a total of 2 weekly downloads. As such, react-redux-human-hooks popularity was classified as not popular.
We found that react-redux-human-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.