Returns an OperationFunction that emits a default value if the source is empty.
Type of items emitted by the source.
Value to emit if the source is empty.
An OperationFunction that emits a default value if the source is empty.
const result = defaultIfEmpty('A')([]);console.log([...result]); // ['A'] Copy
const result = defaultIfEmpty('A')([]);console.log([...result]); // ['A']
Returns an OperationFunction that emits a default value if the source is empty.