-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
URLStore should be refactored and pluggable #166
Comments
yessir! |
👍 |
@seanadkinson Maybe we could reuse the <Routes location="hash"/> <!-- sugar for <Routes location={HashLocation}/> -->
<Routes location="history"/> <!-- sugar for <Routes location={HistoryLocation}/> -->
<Routes location={HistoryJsLocation}/> What do you think? |
I like that. |
Here's first pass: odysseyscience@bef9e19 This will add Still need to look closer at the tests. One was failing that said you shouldn't be able to go back before the beginning of history, but according to MDN it isn't supposed to throw an error anyway, so that test may be invalid. This "location handler" API will be really easy to plug History.js into, something like:
And
The refactor also made it easy to see some legacy code in Initial thoughts or suggestions? |
closing, follow #169 |
The
URLStore
is getting a little messy, with essentiallyswitch
statements in most of the methods, with functionality changing based on value of_location
. This lends itself nicely to a refactor with separate implementations for each type. This would also allow for other implementations, such as an implementation that supports History.js.The text was updated successfully, but these errors were encountered: