import { createStore } from 'redux';
import createApplication from 'redux-hooked';
const { useStore, useDispatch, useAction } = createApplication(store);
// Create your application specific hooks and export them
const getConnectionStatus = state => state.status;
export function useConnectionStatus() {
const { name, age } = useStore((state) => ({
name: state.name,
age: state.age,
}));
return useStore(getConnectionStatus);
}
const updateUrl = url => ({ type: 'UPDATE_URL', payload: url });
export function useUpdateUrl() {
return useAction(updateUrl);
}
export function useUserData(id) {
const { name, age } = useStore(state => state.users[id], [id]);
}
-
Notifications
You must be signed in to change notification settings - Fork 1
Bhoos/redux-hooked
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
The react-redux replacement with hooks
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published