Function createStepGenerator

  • next処理ごとにコールバック関数を実行するGeneratorを生成

    Example

    const gen = createStepGenerator((cnt)=> {
    console.log("cnt:", cnt);
    }, 2);
    gen.next() // "cnt:0"
    get.next() // "cnt:1"
    get.next() // no log...

    Type Parameters

    • C = any

    Parameters

    • cb: CallbackWithCtx<C>
    • duration: number
    • context: null | C = null

      optional

    Returns Generator<number>

Generated using TypeDoc