Skip to content

Type Alias: IntervalOptions ​

IntervalOptions = object

Defined in: packages/rx/src/IntervalSubject.ts:4

Properties ​

autoStart? ​

optional autoStart?: boolean

Defined in: packages/rx/src/IntervalSubject.ts:6

Whether to start the timer immediately. Default: false


delay? ​

optional delay?: number

Defined in: packages/rx/src/IntervalSubject.ts:9

Interval duration in milliseconds. Default: 1000


ensureIncrement? ​

optional ensureIncrement?: boolean

Defined in: packages/rx/src/IntervalSubject.ts:23

When true, derive each emitted value from the elapsed time since the interval started, rather than incrementing from the most recently emitted value.

This keeps the value aligned with the number of intervals expected to have elapsed if timer callbacks are delayed. Missed increments may be applied in a single update; callbacks are not replayed for each missed interval.

This is useful when the browser or device throttles timeouts/intervals.

Default: true


incrementBy? ​

optional incrementBy?: number

Defined in: packages/rx/src/IntervalSubject.ts:29

Number to increment the counter by. Default: 1


initialValue? ​

optional initialValue?: number

Defined in: packages/rx/src/IntervalSubject.ts:26

Initial counter value. Default: 0


pauseIf? ​

optional pauseIf?: (this, currentValue, nextValue) => boolean

Defined in: packages/rx/src/IntervalSubject.ts:38

Optional, callback invoked before every interval to determine whether timer should pause or continue running.

If returns true, the counter will pause but the counter will remain unchanged.

Default: undefined

Parameters ​

this ​

IntervalSubject

currentValue ​

number

nextValue ​

number

Returns ​

boolean


stopIf? ​

optional stopIf?: (this, currentValue, nextValue) => boolean

Defined in: packages/rx/src/IntervalSubject.ts:51

Optional, callback invoked before every interval to determine whether timer should stop or continue running.

If returns true, the counter will stop and reset to 0.

Default: undefined

Parameters ​

this ​

IntervalSubject

currentValue ​

number

nextValue ​

number

Returns ​

boolean