Re-initialize the store
reset​
const { reset } = cervello({ example: true })
Description​
Function that allows you to reset the store to the initial value passed to the cervello
function.
If you have set a name for the store, the returned object property will be reset{name}Store
Example​
- JavaScript
- TypeScript
import { reset } from './user-store'
const LogoutButton = () => (
<button onClick={() => reset()}>
Logout
</button>
)
import { reset } from './user-store'
const LogoutButton = () => (
<button onClick={() => reset()}>
Logout
</button>
)