Options
All
  • Public
  • Public/Protected
  • All
Menu

The SerialCancelable is an IAssignCancelable whose underlying cancelable reference can be swapped for another and on each swap the previous reference gets canceled.

Example:

const ref = SerialCancelable()
ref.update(c1) // sets the underlying cancelable to c1
ref.update(c2) // cancels c1, swaps the underlying cancelable to c2

ref.cancel() // also cancels c2
ref := c3 // also cancels c3, because s is already canceled

Also see SerialCancelable, which is similar, except that it cancels the old cancelable upon assigning a new cancelable.

Hierarchy

  • SerialCancelable

Implements

Index

Constructors

Methods

Constructors

constructor

Methods

cancel

  • cancel(): void

isCanceled

  • isCanceled(): boolean

update

Static empty

Static of

  • Initiates an SerialCancelable reference and assigns it a reference that wraps the given cb callback.

    So this code:

    SerialCancelable.of(() => console.log("cancelled"))
    

    Is equivalent to this:

    const ref = SerialCancelable.empty()
    ref.update(Cancelable.of(() => console.log("cancelled")))
    

    Parameters

    • cb: function
        • (): void
        • Returns void

    Returns SerialCancelable

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc