Skip to content

Type Alias: UseRx_Options<TIn, TOut, ThisArg>

UseRx_Options<TIn, TOut, ThisArg> = object

Defined in: packages/rx-react/src/useRx.ts:182

Type Parameters

TIn

TIn

TOut

TOut

ThisArg

ThisArg = unknown

Properties

defer?

optional defer?: number

Defined in: packages/rx-react/src/useRx.ts:184

Delay in milliseconds to debounce or throttle state updates.


deferOptions?

optional deferOptions?: DeferredOptions<ThisArg>

Defined in: packages/rx-react/src/useRx.ts:186

Configuration for the deferral logic (e.g., throttle vs debounce).


initialValue?

optional initialValue?: TOut

Defined in: packages/rx-react/src/useRx.ts:190

The value used during the initial render if the observable has not yet emitted.


merge?

optional merge?: TOut extends object ? boolean : never

Defined in: packages/rx-react/src/useRx.ts:195

If true, performs a shallow merge ({...prev, ...next}) when the value is an object. New properties will overwrite existing ones.


skipEmits?

optional skipEmits?: number

Defined in: packages/rx-react/src/useRx.ts:201

Number of initial emissions to ignore from the source observable.

Default: 1 if source is a BehaviorSubject, otherwise 0.


transform?

optional transform?: (newValue?, prevValue?, prevError?) => TOut | undefined | void

Defined in: packages/rx-react/src/useRx.ts:210

A callback to modify the incoming value before it hits the state. Return undefined to use the raw value, or the previous value to skip the update.

Parameters

newValue?

TIn

new value received in the source observable

prevValue?

TOut

previously transformed value (if any)

prevError?

UseRx_Error

previous error (if any)

Returns

TOut | undefined | void