1.0.0 • Published 2 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
2 years ago
0.1.0
3 years ago
0.0.6-alpha.1
4 years ago
0.0.6-alpha.0
4 years ago
0.0.5-alpha.12
4 years ago
0.0.5-alpha.11
4 years ago
0.0.5-alpha.9
4 years ago
0.0.5-alpha.7
4 years ago
0.0.5-alpha.6
4 years ago
0.0.5-alpha.4
4 years ago
0.0.5-alpha.3
4 years ago
0.0.5-alpha.2
4 years ago