I'm building an app where routers (and their views) are placed within virtual windows within the app. The windows have their own back/forwards buttons and it seems that I have no way of knowing if there are any pages to go back or forwards to.
Proposed solution
Exposing extra methods on router/history could be very useful (e.g. canGoBack, canGoForwards).
Another option would be adding some kind of indicator to what happens to history state in listener callbacks, so I can track a counter myself.
Or give access to the full browser history stack (which I guess is only an issue for the memory history), but a simple number or boolean would suffice for my use-case.
Describe alternatives you've considered
I looked in the API docs and couldn't find any useful methods/fields on the router/history.
This has been requested before. There is no native api to check for that but you can write to history.state after each navigation to create the behavior you want
What problem is this solving
I'm building an app where routers (and their views) are placed within virtual windows within the app. The windows have their own back/forwards buttons and it seems that I have no way of knowing if there are any pages to go back or forwards to.
Proposed solution
Describe alternatives you've considered
I looked in the API docs and couldn't find any useful methods/fields on the router/history.