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 building an application that has page state (such as uploads), it can be powerful to be able to prompt the user before they leave the page. In traditional web apps we are able to use beforeunload in order to warn / prompt the user.
When building an application that has page state (such as uploads), it can be powerful to be able to prompt the user before they leave the page. In traditional web apps we are able to use
beforeunload
in order to warn / prompt the user.In SPA land however we need to implement something similar for in app navigation. Currently the router https://github.com/sveltejs/kit/blob/master/packages/kit/src/runtime/internal/router/index.js does not expose hooks like this
Looking at prior art react-router has a concept of a Prompt
https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/api/Prompt.md
Ember has a concept of a route willTransition
https://guides.emberjs.com/release/routing/preventing-and-retrying-transitions/
Backbone has the ability to return false from execute
https://backbonejs.org/#Router-route
The text was updated successfully, but these errors were encountered: