Options
All
  • Public
  • Public/Protected
  • All
Menu

Encapsulate a closure inside an object.

Hierarchy

  • CancelScope

Index

Constructors

Properties

Methods

Constructors

constructor

  • new CancelScope(cleanup: () => Promise<void>): CancelScope
  • Parameters

    • cleanup: () => Promise<void>

      Closure to encapsulate

        • (): Promise<void>
        • Returns Promise<void>

    Returns CancelScope

Properties

Private #cleanup

#cleanup: () => Promise<void>

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

Methods

cancel

  • cancel(): Promise<void>
  • Calls the encapsulated closure.

    Returns Promise<void>

Generated using TypeDoc