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

dispatching the current route has no effect #49

Open
hedgepigdaniel opened this issue Jul 16, 2019 · 3 comments · May be fixed by #66
Open

dispatching the current route has no effect #49

hedgepigdaniel opened this issue Jul 16, 2019 · 3 comments · May be fixed by #66

Comments

@hedgepigdaniel
Copy link
Collaborator

This could be useful for example to scroll to a particular hash on the page (even if it is already in the URL)

Currently the transformAction middleware blocks actions that match the current route exactly, because req.isDoubleDispatch() is true.

@hedgepigdaniel
Copy link
Collaborator Author

Reproduceable with the boilerplate on the repro/scroll branch. Try using one of the section links in the sidebar. Then scroll away from that section, and notice that clicking on the same section link does not scroll back to it.

@Guria
Copy link

Guria commented Jul 30, 2019

I also faced with this behavior. I tried to dispatch same action but with different state property set. Unfortunately rudy doesn't checks if state is different.

@hedgepigdaniel
Copy link
Collaborator Author

That's an interesting point about how it doesn't check for a different state in isDoubleDispatch. It probably should, so PR welcome.

That said, such a PR would have to choose a way of comparing the state. Browsers are meant to use the structured clone algorithm to serialize the state - so probably that would be a good way to compare it.

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 a pull request may close this issue.

2 participants