ui-router / redux

UI-Router plugin for Redux integration
MIT License
12 stars 6 forks source link

Redux Actions only include onStart and onFinish #8

Closed lawsumisu closed 5 years ago

lawsumisu commented 5 years ago

Currently, the only redux actions for UIRouter transitions are for onStart and onFinish. Based on https://ui-router.github.io/guide/transitions#lifecycle-events, even when the onFinish event fires, the transition has not actually completed, meaning that if a user wants to get the current router state values, they would have to use transition.to() rather than transition.router.globals.current. The problem is that transition.to() doesn't always have all the params for the next transition (and accessing them requires using param.value), making it tricky to depend on the onFinish event in some cases.

I have a fix (https://github.com/ui-router/redux/pull/7) that just adds dispatch for the onSuccess event, which, when fired should have the router state updated successfully.

elboman commented 5 years ago

Hey, sorry for letting this sit here for a while. I've merged your PR, I'm adding a couple of changes and I should be able to push a new version of the plugin on npm soon!