ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
23 lines (21 loc) • 488 B
text/typescript
import { useStoreContext } from './useStoreContext';
/**
* Get a callback to remove all items from the store
*
* @example
* import { useResetStore } from 'react-admin';
*
* const ResetPrefs = () {
* const reset = useResetStore();
*
* const handleClick = () => {
* reset();
* };
*
* return <Button onClick={handleClick}>Reset preferences</Button>;
* }
*/
export const useResetStore = () => {
const { reset } = useStoreContext();
return reset;
};