You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When basing the app around internal links which add entries to the browser history it could be useful with a persistence type which stores the values in the history state entries (history.pushState(state, ...)).
I know that ideally most/all such state would be part of the URL as this has more advantages beyond preserving the state on back/forward. But sometimes this can be a bit tricky - using URL parameters for state does require a certain app architecture - so I think it could be useful to easily add some state to the history entry "under the hood".
I think this could be reasonable easy to implement. Do a replaceState({...history.state, ...historyProps}, ...) each time a "history-state persisted" property is changed. Then restore these in a "popstate" event handler.
(I could not find any previous discussion on this topic)
The text was updated successfully, but these errors were encountered:
gvwilson
changed the title
[Feature Request] New persistence_type: history_state
add new persistence_type: history_state
Sep 4, 2024
When basing the app around internal links which add entries to the browser history it could be useful with a persistence type which stores the values in the history state entries (
history.pushState(state, ...)
).I know that ideally most/all such state would be part of the URL as this has more advantages beyond preserving the state on back/forward. But sometimes this can be a bit tricky - using URL parameters for state does require a certain app architecture - so I think it could be useful to easily add some state to the history entry "under the hood".
I think this could be reasonable easy to implement. Do a
replaceState({...history.state, ...historyProps}, ...)
each time a "history-state persisted" property is changed. Then restore these in a "popstate" event handler.(I could not find any previous discussion on this topic)
The text was updated successfully, but these errors were encountered: