js-util

Home > rc-js-util > promiseRejectFalsey

promiseRejectFalsey() function

Returns a Promise of rejection with the supplied error if the value is falsy.

Signature:

export declare function promiseRejectFalsey(value: Promise<boolean> | boolean, error: unknown): Promise<void>;

Parameters

Parameter Type Description
value Promise<boolean> | boolean  
error unknown  

Returns:

Promise<void>

Remarks

See promiseRejectFalsey().