VirtualAction

class stable

class VirtualAction<T> extends AsyncAction {
  constructor(scheduler: VirtualTimeScheduler, work: (this: SchedulerAction<T>, state?: T) => void, index: number = (scheduler.index += 1))
  protected active: boolean
  protected scheduler: VirtualTimeScheduler
  protected work: (this: SchedulerAction<T>, state?: T) => void
  protected index: number
  schedule(state?: T, delay: number = 0): Subscription
  protected requestAsyncId(scheduler: VirtualTimeScheduler, id?: any, delay: number = 0): any
  protected recycleAsyncId(scheduler: VirtualTimeScheduler, id?: any, delay: number = 0): any
  protected _execute(state: T, delay: number): any
}

Constructor

constructor(scheduler: VirtualTimeScheduler, work: (this: SchedulerAction<T>, state?: T) => void, index: number = (scheduler.index += 1))

Parameters

scheduler

Type: VirtualTimeScheduler.

work

Type: (this: SchedulerAction, state?: T) => void.

index

Optional. Default is (scheduler.index += 1).

Type: number.

Properties

Property Type Description
active boolean
scheduler VirtualTimeScheduler Declared in constructor.
work (this: SchedulerAction<T>, state?: T) => void Declared in constructor.
index number Declared in constructor.

Methods

schedule(state?: T, delay: number = 0): Subscription

Parameters

state

Optional. Default is undefined.

Type: T.

delay

Optional. Default is 0.

Type: number.

Returns

Subscription

protected requestAsyncId(scheduler: VirtualTimeScheduler, id?: any, delay: number = 0): any

Parameters

scheduler

Type: VirtualTimeScheduler.

id

Optional. Default is undefined.

Type: any.

delay

Optional. Default is 0.

Type: number.

Returns

any

protected recycleAsyncId(scheduler: VirtualTimeScheduler, id?: any, delay: number = 0): any

Parameters

scheduler

Type: VirtualTimeScheduler.

id

Optional. Default is undefined.

Type: any.

delay

Optional. Default is 0.

Type: number.

Returns

any

protected _execute(state: T, delay: number): any

Parameters

state

Type: T.

delay

Type: number.

Returns

any

© 2015–2021 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors.
Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0.
https://rxjs.dev/api/index/class/VirtualAction