import { useGlobalStore } from 'store' ; import bindActions from 'store/bindActions' ; import itemsReducer from 'store/items' ; const { actions } = itemsReducer ; /**
 * useItems Custom Hook
 */ const useItems = ( ) => { const { state , dispatch } = useGlobalStore ( ) ; const { items } = state ; const { addItem , resetItems , completeItem } = actions ; const itemsActions = bindActions ( { addItem , resetItems , completeItem } , dispatch ) ; return { items , ... itemsActions } ; } ; export default useItems ;