Resets the whole store to its original state
None
Nothing
This example demonstrates how to use reset
to reset the store when the user logs out.
import React from 'react';
import { reset, connect } from '@brigad/redux-rest-easy';
const LogoutButton = ({ logout }) => (
<button onClick={logout}>{'Logout'}</button>
);
const mapDispatchToProps = dispatch => ({
logout: () => dispatch(reset()),
});
export default connect(null, mapDispatchToProps)(LogoutButton);
- Just like any action, you have to dispatch
reset
for it to work