connect = (
      getRemoteGateway,
      cancelIncarnation,
      incarnationCancelled,
      disposeIncarnation,
    ) => {
      const { state: nextState, remoteGateway } = state.connect(
        getRemoteGateway,
        cancelIncarnation,
        incarnationCancelled,
        disposeIncarnation,
      );
      state = nextState;
      return remoteGateway;
    }
@param {() => Promise<EndoGateway>} getRemoteGateway
@param {(error: Error) => void} cancelIncarnation
@param {Promise<never>} incarnationCancelled
@param {() => void} disposeIncarnation