withOptions
withOptions
withOptions(defaultOptions: IRequestOptions, func: T): (funcArgs: Parameters<T>) => ReturnType<T>
Allows you to wrap individual methods with a default set of request options. This is useful to avoid setting the same option more then once and allows for interacting and setting defaults in a functional manner.
Parameters
Parameter | Type | Notes |
---|---|---|
default | IRequestOptions | The options to pass into to the |
func | T | Any function that accepts anything extending |
Returns
(funcArgs: Parameters<T>) => ReturnType<T>
A copy of func
with the defaultOptions
passed in as defaults.
function(funcArgs: Parameters<T>): ReturnType<T>
Allows you to wrap individual methods with a default set of request options. This is useful to avoid setting the same option more then once and allows for interacting and setting defaults in a functional manner.
Parameters
Parameter | Type |
---|---|
func | Parameters<T> |
Returns
ReturnType<T>
A copy of func
with the defaultOptions
passed in as defaults.