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

Add location.delta #36

Closed
xpepermint opened this issue Aug 30, 2015 · 5 comments
Closed

Add location.delta #36

xpepermint opened this issue Aug 30, 2015 · 5 comments
Labels

Comments

@xpepermint
Copy link

Hey. It would be great to know the direction of the transition thus we can set a different animation (with react-router) for forward/back actions. I first though that I can depend on action but browser back/forward buttons are always POP. I would appreciate if we can add this feature, thx?

@mjackson
Copy link
Member

mjackson commented Sep 5, 2015

I think I'd prefer to have something a bit more general, like location.delta that would give us the n the user supplied to go(n). When going back, location.delta would be -1. Likewise, when going forward location.delta would be 1.

@xpepermint
Copy link
Author

Even better :).

@mjackson mjackson changed the title Add location.direction Add location.delta Sep 11, 2015
@ricardosoeiro
Copy link

This would be a great improvement! I'm also relying on location.action === "POP" to detect back transitions and perform a different animation, but it is not reliable because of the (less frequent) forward transitions. Is this planned?

@mjackson
Copy link
Member

I think this would make a great addition to the library, but haven't had time to get to it. I would love it if someone else could step up and take a shot at this. It's a feature that a lot of people seem to want.

@mjackson
Copy link
Member

This is superseded by #334. If we can figure out how to provide location.index, users can derive the delta for themselves.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants