UNPKG

react-hooks-easy

Version:
21 lines (17 loc) 471 B
import React from 'react' import InitialStore from "./InitialStore"; export function useObject(namespace, initialValue){ const {value, add, reset, reInitial, del, splice} = InitialStore('object_'+namespace, initialValue); return { value, set: add, // alias add, reset, reInitial, del, splice } } export function useMap(namespace, initialValue){ return useObject(namespace, initialValue); }