Documents / @faasjs/react / Options
Type Alias: Options
Options:
RequestInit
&object
Type declaration
baseUrl?
optional
baseUrl:BaseUrl
beforeRequest()?
optional
beforeRequest: ({ action, params, options, headers, }
) =>Promise
<void
>
trigger before request
Parameters
• { action, params, options, headers, }
• { action, params, options, headers, }.action: string
• { action, params, options, headers, }.headers: Record
<string
, string
>
• { action, params, options, headers, }.options: Options
• { action, params, options, headers, }.params: Record
<string
, any
>
Returns
Promise
<void
>
headers?
optional
headers:Record
<string
,string
>
request()?
optional
request: <PathOrData
>(url
,options
) =>Promise
<Response
<FaasData
<PathOrData
>>>
custom request
Type Parameters
• PathOrData extends FaasAction
Parameters
• url: string
• options: Options