Created
January 10, 2020 10:37
-
-
Save nickmeldrum/a6da8ea7d467f039ef3a92d9920174ff to your computer and use it in GitHub Desktop.
computed property always empty string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Model { | |
router?: Reducer<any>; | |
routing: { | |
push: Thunk<Model, string>; | |
currentBoard: Computed<any>; | |
}; | |
data: Data; | |
ui: Ui; | |
}; | |
const { | |
createReduxHistory, | |
routerMiddleware, | |
routerReducer, | |
} = createReduxHistoryContext({ | |
history: createBrowserHistory(), | |
reduxTravelling: true, | |
}); | |
const model: Model = { | |
router: reducer(routerReducer), | |
routing: { | |
push: thunk((actions, payload, { dispatch }) => dispatch(push(payload))), | |
currentBoard: computed(state => { | |
return state.router ? state.router.location.pathname : ''; | |
}), | |
}, | |
data, | |
ui, | |
}; | |
export default createStore(model, {middleware: [routerMiddleware]}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment