docs: function select(state, selector) {
      if (state == undefined)
          return;
      if (selector == undefined)
          return state;
      try {
          return selector(state);
      }
      catch (error) {
          return undefined;
      }
  }