Skip to main content

Function: withFallback()

withFallback<T>(value: T | null | undefined, fallback: T): T

Defined in: electron/services/monitoring/shared/monitorServiceHelpers.ts:122

Returns the provided value when it is not null/undefined, otherwise yields the specified fallback.

Type Parameters

T

T

The value type.

Parameters

value

Candidate value to unwrap.

T | null | undefined

fallback

T

Fallback value to use when value is nullish.

Returns

T