Hi! I am a longtime developer with a passion to empower other developers to be their best. I focus on cloud development and everything related to data access from .NET and .NET Core.
Rollup + TypeScript + Pug + SASS template with no plan for JavaScript frameworks, whatsoever
In short, more than history.pushState, you also need window.dispatchEvent(new PopStateEvent('popstate', { state: { to } })); if you don't have history.go.
Now, you can listen to popstate events.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Do you have any idea how to implement hash-less routing on the client? I've tried and I failed.
Good question! I'll explore that. There are libraries that handle it but I will look into a pure source solution.
Do you mean with window.history? (developer.mozilla.org/en-US/docs/W...)
Yes, probably by manipulating window history
I have my successful solution here. Might write an article later.
patarapolw / minimal-rollup-ts-pug-sass-template
Rollup + TypeScript + Pug + SASS template with no plan for JavaScript frameworks, whatsoever
In short, more than
history.pushState
, you also needwindow.dispatchEvent(new PopStateEvent('popstate', { state: { to } }))
; if you don't havehistory.go
.Now, you can listen to
popstate
events.