Frame
Options
requestInit
- Type:
RequestInit - Default:
{}
Customizes the options for the fetch request.
headers
- Type:
Record<string, string> - Default:
{}
Adds custom headers to the fetch request. The headers merge with any $options.requestInit.headers already defined.
history
- Type:
boolean - Default:
false
Updates the browser's history when performing a request. The historyPush function is used in the background.
Getters
id
- Return:
string - Default:
this.$el.id
client
- Return:
typeof fetch - Default:
window.fetch.bind(window)
requestInit
- Return:
RequestInit - Default: merged
requestInitandheadersoptions with additional custom headers
By default, the following custom headers will be added:
user-agent: it will uses the current browser user-agent information with an additional@studiometa/ui/Framesuffix.x-requested-by: @studiometa/ui/Frame
Emits
frame-fetch-before
- Parameters:
url(URL): the URL requestedrequestInit(RequestInit): options for the fetch function
Emitted before the request starts.
frame-fetch
- Parameters:
url(URL): the URL requestedrequestInit(RequestInit): options for the fetch function
Emitted when the request starts.
frame-fetch-after
- Parameters:
url(URL): the URL requestedrequestInit(RequestInit): options for the fetch functioncontent(string | Error): the content of the request if successful, an error otherwise
Emitted after the fetch request, be it successful or not. The third parameter can be either the content of the response or an error instance.
frame-content
- Parameters:
url(URL): the URL requestedrequestInit(RequestInit): options for the fetch functioncontent(string): the content of the response
Emitted when the content of the request has been successfully received, but before its insertion in the current page.
frame-content-after
- Parameters:
url(URL): the URL requestedrequestInit(RequestInit): options for the fetch functioncontent(string): the content of the response
Emitted after each FrameTarget component has received and updated its content, but before the final update on the root of the application which scan the updated content for components to mount.
frame-error
- Parameters:
url(URL): the URL requestedrequestInit(RequestInit): options for the fetch functionerror(Error): a fetch error
Emitted when the fetch request or the update of the content throw an error.