code: function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {
      var resultSelector;
      var initialState;
      if (arguments.length == 1) {
          var options = initialStateOrOptions;
          initialState = options.initialState;
          condition = options.condition;
          iterate = options.iterate;
          resultSelector = options.resultSelector || _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
          scheduler = options.scheduler;
      }
      else if (resultSelectorOrObservable === undefined || Object(_util_isScheduler__WEBPACK_IMPORTED_MODULE_2__["isScheduler"])(resultSelectorOrObservable)) {
          initialState = initialStateOrOptions;
          resultSelector = _util_identity__WEBPACK_IMPORTED_MODULE_1__["identity"];
          scheduler = resultSelectorOrObservable;
      }
      else {
          initialState = initialStateOrOptions;
          resultSelector = resultSelectorOrObservable;
      }
      return new _Observable__WEBPACK_IMPORTED_MODULE_0__["Observable"](function (subscriber) {
          var state = initialState;
          if (scheduler) {
              return scheduler.schedule(dispatch, 0, {
                  subscriber: subscriber,
                  iterate: iterate,
                  condition: condition,
                  resultSelector: resultSelector,
                  state: state
              });
          }
          do {
              if (condition) {
                  var conditionResult = void 0;
                  try {
                      conditionResult = condition(state);
                  }
                  catch (err) {
                      subscriber.error(err);
                      return undefined;
                  }
                  if (!conditionResult) {
                      subscriber.complete();
                      break;
                  }
              }
              var value = void 0;
              try {
                  value = resultSelector(state);
              }
              catch (err) {
                  subscriber.error(err);
                  return undefined;
              }
              subscriber.next(value);
              if (subscriber.closed) {
                  break;
              }
              try {
                  state = iterate(state);
              }
              catch (err) {
                  subscriber.error(err);
                  return undefined;
              }
          } while (true);
          return undefined;
      });
  }
docs: PURE_IMPORTS_START _Observable,_util_identity,_util_isScheduler PURE_IMPORTS_END