kitze / mobx-router

A simple router for MobX + React apps
509 stars 66 forks source link

Feature - Async beforeEnter and beforeExit #25

Closed timkendall closed 6 years ago

timkendall commented 7 years ago

This PR adds the ability to have asynchronous beforeEnter and beforeExit route hooks. There is an edge case that should possibly be addressed by this PR before merging - the case being when another transition happens before a previous async transition has been resolved.

Please give feedback!

timkendall commented 7 years ago

Actually need to handle the case when an async route fails as well.

kitze commented 7 years ago

Hey @timkendall, any updates on this? I wouldn't like to bake this in the router, but if it works in all cases I would love to include it.

timkendall commented 7 years ago

@kitze No updates on my end. Honestly it's your call. Haven't really used it enough to consider it "battle-tested". Idk if it's worth putting it in behind an experimental feature flag that consumers can enable if they choose?

sadasant commented 7 years ago

Our team really needs this feature.

kitze commented 6 years ago

This has been implemented in another PR.