Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use simple-redux-router UPDATE_PATH action type to clear counter #12

Open
wants to merge 1 commit into
base: routed-email-app
Choose a base branch
from

Conversation

naw
Copy link
Owner

@naw naw commented Dec 6, 2015

This PR illustrates how to clear instance-specific state by listening to the UPDATE_PATH action type triggered by simple-redux-router. The basic idea is certain reducers that hold page-specific data (like insurance coverages) would pre-emptively reset themselves every time the route changes.

This PR is only addressing how to reset state, not how to fetch stale data or initial data.

The alternative to this approach is using onEnter to dispatch an action that clears the state for a specific reducer. This is the approach in the main routed-email-app branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants