Open roman-sitewits opened 8 years ago
Issue 1. I think you missed that it does a replace state and not a push state for state 3 so first we push state 1, then push state 2, then replace state which replaces state 2 with state 3 so naturally our states are now 1 -> 3 not 1 -> 2 -> 3 so going back brings you to state 1.
Issue 2. Not really sure how you get state C when you are already on it. Maybe their are multiple states that are the same.
Issue 3. The fact that it does a statechange when pushing was confusing to me at first and there are quite a few issues talking about this but an easy solution is before you do a push state set a variable to true and on statechange dont do anything if it is set and set it back to false. Be careful about pushing the same state though as pushing the same state wont trigger a statechange, you can get around this by adding some random data to the state there are issues about this as well.
I do agree that this has it quirks and can be tricky to use at times but its not nearly as bad as you make it out to be. Once you figure out how to use it you can do alot with it.
To start, the whole library is screwed up, so many issues and so many hours lost. I'd suggest not releasing a crappy library so that hundreds of people don't waste their time.
Now onto the issues.
And on behalf of others, thanks for wasting hundreds man-hours. I could have gladly spent this time helping you improve your library, now I'm behind schedule. I'd suggest rename it to [attempted.history.js] so that people don't accidentally assume that it's a solid wrapper for the history API.