refactor: changed nav store to use nav index and selector instead of initNav action

This commit is contained in:
Torkel Ödegaard
2018-09-02 10:36:36 -07:00
parent 2ac202b22f
commit 7b06800295
17 changed files with 174 additions and 202 deletions
+1 -2
View File
@@ -1,4 +1,3 @@
import { initNav } from './navModel';
import { updateLocation } from './location';
export { initNav, updateLocation };
export { updateLocation };
+9 -7
View File
@@ -1,11 +1,13 @@
export type Action = InitNavModelAction;
export type Action = UpdateNavIndexAction;
export interface InitNavModelAction {
type: 'INIT_NAV_MODEL';
args: string[];
// this action is not used yet
// kind of just a placeholder, will be need for dynamic pages
// like datasource edit, teams edit page
export interface UpdateNavIndexAction {
type: 'UPDATE_NAV_INDEX';
}
export const initNav = (...args: string[]): InitNavModelAction => ({
type: 'INIT_NAV_MODEL',
args: args,
export const updateNavIndex = (): UpdateNavIndexAction => ({
type: 'UPDATE_NAV_INDEX',
});