redux-ui-router
redux-ui-router copied to clipboard
Add ability to import the constants of the action-types
Would be great to have ability to import the constants of the action-types .
Use case: I want to listen on some action and perform side-effect now I need to hardcode the name of the action
@ondrasak I'm not sure that I fully understand your proposal. Could explain it in a bit more detail?
let say I want the behaviour: When route/state is changed -> close side navigation
so in some redux-middleware (i my case redux-observable) -> I will check all action if their type is equal to '@@reduxUiRouter/$stateChangeStart' -> if YES then perform desired action
so I need to get somehow the string "@@reduxUiRouter/$stateChangeStart"
would be great to have ability to import that constant
import {STATE_CHANGE_START} from "redux-ui-router"
// or
import {actionTypes} from "redux-ui-router" // -> actionTypes.STATE_CHANGE_START
I understand now. As opposed to maintaining those constants externally. I may get round to this in a week or so but open to a PR in the meantime 👍
Yes, agreed I currently have to redefine the ui router action types in my app.
Actually, a slightly more stable hack than defining them yourselves is to use the action creators:
const STATE_GO = stateGo().type
Incidentally, you might want to change your namespacing - it breaks https://github.com/wix/redux-saga-tester/blob/master/src/SagaTester.js#L45