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

Revert state on error #50

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

calebsoper
Copy link

Issue #20
I tested this by throwing an error on example and it didn't update the pager number only updates the pager number when data is successfully set.

const nextPage = event.target.getAttribute('data-page')
props.refreshData(props.name, {...props.filter, page: nextPage})
const currentPage = props.filter.page
const nextPage = parseInt(event.target.getAttribute('data-page'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add radix:
parseInt(event.target.getAttribute('data-page'), 10)

src/reducer.js Outdated
filter: {
...state.filter,
page: state.filter.nextPage || state.filter.page
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like this was on the right path, but it doesn't look completed

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.

3 participants