UNPKG

redux-first-router

Version:

think of your app in states not routes (and, yes, while keeping the address bar in sync)

18 lines (13 loc) 316 B
// @flow import type { Action } from '../flow-types' import setKind from '../pure-utils/setKind' export default (action: Action, type?: string, payload?: any) => { action = setKind(action, 'redirect') if (type) { action.type = type } if (payload) { action.payload = payload } return action }