(register endpoint & {:keys [timeout] :or {timeout default-timeout}})
Registers an effects handler that will dispatch requests to the server
referred to by endpoint
using via. An optional timeout
can
be provided which will be used for requests if no :timeout is
provided in the individual request.
The requests can be provided as a sequence or a single map of the following form:
{:event <re-frame-via event registered on the server> :on-reply <re-frame event to dispatch on reply from the server> :on-timeout <re-frame event to dispatch on error> :timeout <optional timeout in ms> :late-reply <a boolean indicating whether a late reply received after the timeout should be delivered. Defaults to false>}
The :on-reply and :on-timeout can be omitted for one-way events to the server. However if a reply from the server is expected, both must be provided. Additionally all requests that expect a reply from the server must have a timeout, which can be provided when the effects handler is registered and overridden in an individual request.
Registers an effects handler that will dispatch requests to the server referred to by `endpoint` using via. An optional `timeout` can be provided which will be used for requests if no :timeout is provided in the individual request. The requests can be provided as a sequence or a single map of the following form: {:event <re-frame-via event registered on the server> :on-reply <re-frame event to dispatch on reply from the server> :on-timeout <re-frame event to dispatch on error> :timeout <optional timeout in ms> :late-reply <a boolean indicating whether a late reply received after the timeout should be delivered. Defaults to false>} The :on-reply and :on-timeout can be omitted for one-way events to the server. However if a reply from the server is expected, both must be provided. Additionally all requests that expect a reply from the server must have a timeout, which can be provided when the effects handler is registered and overridden in an individual request.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close