guardFunction()
guardFunction()
const guardFunction = <Type extends Function, Payload extends object>(
value: Type,
callback?: ResultCallback<Type, Payload>,
payload?: Payload
): value is Type => isFunction(value, callback, payload);Generic type variables
TypeextendsFunction
Payloadextendsobject=object
Parameters
value: Type
callback?: ResultCallback<Type, Payload>
payload?: Payload
Return type
value is Type
Returns
Example usage
Last updated