(options: {all: boolean}): void
(requestId: string): void
(requestIds: string[]): voidThe Request action calls a request, or if used during an onInit or onEnter events, calls those requests while a page loads.
Request can be used to call all requests on a context, a list of requests, or a single request. The Request action is synchronous, actions defined after
it will only run once all the called requests have returned.
To call requests that load data, the onInitAsync and onEnterAsync events can be used. These will execute the actions while the page begins to render. If the onInit or onEnter events are used, the page will only start rendering after the actions have completed.
Request can be called without any parameters to call all requests in the context. It can also be called with a list of requestIds or a single requestId to call.
Parameters
object
all: boolean: All requests in the context are called ifallis set to true.
string
A requestId of the request to call.
string[]
An array of requestIds of the requests to call.
Examples
Call a single request:
- id: call_one_request
type: Request
params: my_request_idCall a list of requests:
- id: call_many_requests
type: Request
params:
- my_request_id_1
- my_request_id_2
- my_request_id_3Call all requests:
- id: call_all
type: Request
params:
all: true