code: function select(state, selector) {
      if (state == undefined)
          return;
      if (selector == undefined)
          return state;
      try {
          return selector(state);
      }
      catch (error) {
          return undefined;
      }
  }
docs: Run selector function on the given state and return it's result. Return undefined if an error occurred
  
  @param {*} state
  @param {StateSelector} selector
  @returns The value return by the selector, undefined if an error occurred.