code: function addState(name, state) {
      if (states[name])
        throw new Error('A state already exist in the router with the name ' + name)
  
      state = stateTree(state)
  
      states[name] = state
  
      // The router is already initialized: Hot patch this state in.
      if (initialized) {
        state.init(router, name)
        registerLeafStates([state], leafStates)
      }
  
      return router
    }
docs: /*
  Add a new root state to the router.
  The name must be unique among root states.