1.0.0 • Published 3 years ago
@use-rematch/plugin-store v1.0.0
@use-rematch/plugin-store
save state to localstorage and recover from localstorage
install
pnpm i @use-rematch/core @use-rematch/plugin-store
usage
import { useRematch } from '@use-rematch/core';
import { createPluginStore } from '@use-rematch/plugin-store'
const PluginStore = createPluginStore()
const useHook = () => {
const { state, dispatch } = useRematch({
name: 'use-rematch-reducer',
state: {
cnt: 0,
loading: false,
},
reducers: {
add: (state) => {
return {
...state,
cnt: state.cnt + 1,
};
},
},
}, { plugins: [PluginStore] });
return { state, dispatch }
}
1.0.0
3 years ago
0.1.0
4 years ago
0.0.6-alpha.1
5 years ago
0.0.6-alpha.0
5 years ago
0.0.5-alpha.12
5 years ago
0.0.5-alpha.11
5 years ago
0.0.5-alpha.9
5 years ago
0.0.5-alpha.7
5 years ago
0.0.5-alpha.6
5 years ago
0.0.5-alpha.4
5 years ago
0.0.5-alpha.3
5 years ago
0.0.5-alpha.2
5 years ago