zambezi / caballo-vivo

Glue code for pure RxJS applications to connect with React-Router, and other operators
2 stars 7 forks source link

Feature request: add ability to prevent user navigation #63

Closed robertgorecki closed 1 year ago

robertgorecki commented 1 year ago

Use case: User is filling in a form and before saving the details, he's clicking a link to navigate to different page. I'd like to be able to show him a notification that unsaved changes will be lost, so that he can decide if he wants to stay on this page or navigate away.

Problem: caballo-vivo is already using history.block() to control managed paths, so using history.block() within consuming app is breaking navigation for managed paths.

Solution: caballo-vivo could export a method to block/unblock navigation