Oh yes. I was considering that. I've stayed for a while with a convention solution - write and toggle replaces, but go adds to the history. You can build on top of that, but I think it's reasonable now.
It manages for you what you want to be in a history. Imagine example with an input which writes on each keyup to the history and going back letter by letter.
So when you click on a "link" it goes to the history. If you play with params on a single view it replaces.
What do you think?
Re:Show HN: Routerless
by AndrewStephens on Monday July 10, 2017 @06:14PM
(#14740158)
Sounds like a good rule of thumb but it really depends on the application.
This is because your write() function uses relaceState() to modify the current url. If you used pushState (like your go() function does) then the browser would correctly maintain history.
Now, maintaining a history of the current state is not always the best thing to do. For instance, on your other demo page, the one where you type your name, you probably don't want to push a history item for each key press.
I think you should consider offering the option to push local history so that an app developer can decide if it makes sense.