Skip to content

Commit

Permalink
refactor(visualizer): Lazy load ui-router vizualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Feb 25, 2018
1 parent 8c86ca6 commit 268072b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/router.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {UIRouterReact, servicesPlugin, hashLocationPlugin} from '@uirouter/react';
import {Visualizer} from '@uirouter/visualizer';

import appStates from './main/states';

// Create a new instance of the Router
export const router = new UIRouterReact();
router.plugin(servicesPlugin);
router.plugin(hashLocationPlugin);
router.plugin(Visualizer);

// Lazy load visualizer
import('@uirouter/visualizer').then(module => router.plugin(module.Visualizer));

// Register the initial (eagerly loaded) states
appStates.forEach(state => router.stateRegistry.register(state));
Expand Down

0 comments on commit 268072b

Please sign in to comment.