refactor: create initial state only once

This commit is contained in:
satyajit.happy
2019-07-16 15:41:16 +02:00
parent ea8655252d
commit 95773de0a3
5 changed files with 66 additions and 65 deletions

View File

@@ -80,8 +80,8 @@ const StackRouter: Router<CommonAction | Action> = {
if (state.routeNames === undefined || state.key === undefined) {
state = {
...state,
routeNames: state.routeNames || routeNames,
key: state.key || `stack-${shortid()}`,
routeNames,
key: `stack-${shortid()}`,
};
}