{"ast":null,"code":"import { identity } from '../util/identity';\nimport { isScheduler } from '../util/isScheduler';\nimport { defer } from './defer';\nimport { scheduleIterable } from '../scheduled/scheduleIterable';\nexport function generate(initialStateOrOptions, condition, iterate, resultSelectorOrScheduler, scheduler) {\n  let resultSelector;\n  let initialState;\n  if (arguments.length === 1) {\n    ({\n      initialState,\n      condition,\n      iterate,\n      resultSelector = identity,\n      scheduler\n    } = initialStateOrOptions);\n  } else {\n    initialState = initialStateOrOptions;\n    if (!resultSelectorOrScheduler || isScheduler(resultSelectorOrScheduler)) {\n      resultSelector = identity;\n      scheduler = resultSelectorOrScheduler;\n    } else {\n      resultSelector = resultSelectorOrScheduler;\n    }\n  }\n  function* gen() {\n    for (let state = initialState; !condition || condition(state); state = iterate(state)) {\n      yield resultSelector(state);\n    }\n  }\n  return defer(scheduler ? () => scheduleIterable(gen(), scheduler) : gen);\n}\n//# sourceMappingURL=generate.js.map","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}