A valid sequence of calls to the methods of an IterationObserver represents an iteration. A valid sequence consists of any number of calls to updateState with the successive non-final values, followed by a final call to either finish with a successful completion value or fail with the alleged reason for failure. After at most one terminating calls, no further calls to these methods are valid and must be rejected.

interface IterationObserver<T> {
    fail: ((reason) => void);
    finish: ((completion) => void);
    updateState: ((nonFinalValue) => void);
}

Type Parameters

  • T

Properties

fail: ((reason) => void)

Type declaration

    • (reason): void
    • Parameters

      • reason: unknown

      Returns void

finish: ((completion) => void)

Type declaration

    • (completion): void
    • Parameters

      • completion: T

      Returns void

updateState: ((nonFinalValue) => void)

Type declaration

    • (nonFinalValue): void
    • Parameters

      • nonFinalValue: T

      Returns void