Liking cljdoc? Tell your friends :D

reacl-c-basics.ajax


check-options-invariants!cljs

(check-options-invariants! options)
source

DELETEcljs

(DELETE uri & [options])
source

delivercljs

(deliver req & [info])

Returns an action to add the given request to the end of the next queue [[delivery-queue]] up in the item tree. An arbitrary info value can be attached, identifying or describing the request.

Returns an action to add the given request to the end of the next
queue [[delivery-queue]] up in the item tree. An arbitrary `info`
value can be attached, identifying or describing the request.
sourceraw docstring

deliverycljs

(delivery item)
(delivery item options)
(delivery item transition manage)

Returns an item that manages execution of Ajax requests in its local state. Use deliver to get an action that can be emitted by item that adds a new delivery job to an internal queue.

Jobs transition from a :pending state, over :running into :completed (successful or not), and for each transition (transition state job) is evaluated on the returned items state, and which can modify it.

Some control over the queue can be achieved by specifying manage which is called on the queue after it changed and must return an updated queue. Newest items are at the end of the queue.

The item function to actually execute the requests can also be explicitly set; it defaults to execute.

Returns an item that manages execution of Ajax requests in its
local state. Use [[deliver]] to get an action that can be emitted by
`item` that adds a new delivery job to an internal queue.

Jobs transition from a :pending state, over :running
into :completed (successful or not), and for each transition `(transition
state job)` is evaluated on the returned items state, and which can modify it.

Some control over the queue can be achieved by specifying `manage`
which is called on the queue after it changed and must return an
updated queue. Newest items are at the end of the queue.

The item function to actually execute the requests can also be
explicitly set; it defaults to [[execute]].
sourceraw docstring

delivery-job!cljs

(delivery-job! req & [info])

Returns a new delivery job, that you can put into the state backing up a [[delivery-queue]].

Returns a new delivery job, that you can put into the state backing
up a [[delivery-queue]].
sourceraw docstring

delivery-job-idcljs

(delivery-job-id rec__14265__auto__)
(delivery-job-id data__14266__auto__ v__14267__auto__)

Lens for the id field from a DeliveryJob record. See reacl-c-basics.ajax/make-delivery-job.

Lens for the `id` field from a [[DeliveryJob]] record. See [[reacl-c-basics.ajax/make-delivery-job]].
sourceraw docstring

delivery-job-infocljs

(delivery-job-info rec__14265__auto__)
(delivery-job-info data__14266__auto__ v__14267__auto__)

Lens for the info field from a DeliveryJob record. See reacl-c-basics.ajax/make-delivery-job.

Lens for the `info` field from a [[DeliveryJob]] record. See [[reacl-c-basics.ajax/make-delivery-job]].
sourceraw docstring

delivery-job-requestcljs

(delivery-job-request rec__14265__auto__)
(delivery-job-request data__14266__auto__ v__14267__auto__)

Lens for the req field from a DeliveryJob record. See reacl-c-basics.ajax/make-delivery-job.

Lens for the `req` field from a [[DeliveryJob]] record. See [[reacl-c-basics.ajax/make-delivery-job]].
sourceraw docstring

delivery-job-responsecljs

(delivery-job-response rec__14265__auto__)
(delivery-job-response data__14266__auto__ v__14267__auto__)

Lens for the response field from a DeliveryJob record. See reacl-c-basics.ajax/make-delivery-job.

Lens for the `response` field from a [[DeliveryJob]] record. See [[reacl-c-basics.ajax/make-delivery-job]].
sourceraw docstring

delivery-job-statuscljs

(delivery-job-status rec__14265__auto__)
(delivery-job-status data__14266__auto__ v__14267__auto__)

Lens for the status field from a DeliveryJob record. See reacl-c-basics.ajax/make-delivery-job.

Lens for the `status` field from a [[DeliveryJob]] record. See [[reacl-c-basics.ajax/make-delivery-job]].
sourceraw docstring

delivery-job?cljs

(delivery-job? thing)

Is object a DeliveryJob record? See reacl-c-basics.ajax/make-delivery-job.

Is object a `DeliveryJob` record? See [[reacl-c-basics.ajax/make-delivery-job]].
sourceraw docstring

DeliveryJobcljs

source

error-responsecljs

(error-response status & [body])
source

executecljs

(execute request)
source

fetchcljs

(fetch req)

Returns an invisible item, that will execute the given request whenever its state is or becomes nil, and set its state to the success or error response as soon as available.

Returns an invisible item, that will
execute the given request whenever its state is or becomes nil, and
set its state to the success or error response as soon as
available.
sourceraw docstring

fetch-oncecljs

(fetch-once req f)

Returns an invisible item, that will execute the given Ajax request once, when mounted. When the request completes with an error or success, then (f state response) is evaluated, which must return a [[reacl-c.core/return]] value.

Returns an invisible item, that will execute the given Ajax
request once, when mounted. When the request completes with an error
or success, then `(f state response)` is evaluated, which must
return a [[reacl-c.core/return]] value.
sourceraw docstring

fetch-whencljs

(fetch-when req cond)

Returns an invisible item, that will execute the given request once if cond is true, and also whenever cond changes from false to true. Updates its state to the response value after each request completed (successful or not).

Returns an invisible item, that will execute the given request once
if `cond` is true, and also whenever `cond` changes from false to
true. Updates its state to the response value after each request
completed (successful or not).
sourceraw docstring

fetch-when+statecljs

(fetch-when+state req cond)

Returns an invisible item, that will execute the given request once if cond is true, and also whenever cond changes from false to true. Updates its state to a tuple of the response and a loading flag:

  • true when a request is started, but hasn't completed yet
  • false when a request is completed. Initialize the state to false or nil.
Returns an invisible item, that will execute the given request once
if `cond` is true, and also whenever `cond` changes from false to
true. Updates its state to a tuple of the response and a loading flag:
- `true` when a request is started, but hasn't completed yet
- `false` when a request is completed.
Initialize the state to false or nil.
sourceraw docstring

GETcljs

(GET uri & [options])
source

(HEAD uri & [options])
source

make-delivery-jobcljs

(make-delivery-job id req info status response)
Construct a `DeliveryJob` record.

`id`: access via [[reacl-c-basics.ajax/delivery-job-id]]
`req`: access via [[reacl-c-basics.ajax/delivery-job-request]]
`info`: access via [[reacl-c-basics.ajax/delivery-job-info]]
`status`: access via [[reacl-c-basics.ajax/delivery-job-status]]
`response`: access via [[reacl-c-basics.ajax/delivery-job-response]]
sourceraw docstring

make-requestcljs

(make-request f uri options)

Construct a Request record.

f: access via reacl-c-basics.ajax/request-f uri: access via reacl-c-basics.ajax/request-uri options: access via reacl-c-basics.ajax/request-options

Construct a `Request` record.

`f`: access via [[reacl-c-basics.ajax/request-f]]
`uri`: access via [[reacl-c-basics.ajax/request-uri]]
`options`: access via [[reacl-c-basics.ajax/request-options]]
sourceraw docstring

make-responsecljs

(make-response ok? value)

Construct a Response record.

ok?: access via reacl-c-basics.ajax/response-ok? value: access via reacl-c-basics.ajax/response-value

Construct a `Response` record.

`ok?`: access via [[reacl-c-basics.ajax/response-ok?]]
`value`: access via [[reacl-c-basics.ajax/response-value]]
sourceraw docstring

map-ok-responsecljs

(map-ok-response req f & args)

Convert the response-value to the given request through a call to (f response & args) if it's an ok response.

Convert the [[response-value]] to the given request through a
call to `(f response & args)` if it's an ok response.
sourceraw docstring

map-responsecljs

(map-response req f & args)

Convert the response to the given request through a call to (f response & args).

Convert the response to the given request through a call to `(f response & args)`.
sourceraw docstring

maybe-show-response-valuecljs

(maybe-show-response-value resp e-pending f-ok & [f-error])
source

ok-responsecljs

(ok-response result)
source

OPTIONScljs

(OPTIONS uri & [options])
source

PATCHcljs

(PATCH uri & [options])
source

POSTcljs

(POST uri & [options])
source

PURGEcljs

(PURGE uri & [options])
source

PUTcljs

(PUT uri & [options])
source

Requestcljs

source

request-fcljs

(request-f rec__14265__auto__)
(request-f data__14266__auto__ v__14267__auto__)

Lens for the f field from a Request record. See reacl-c-basics.ajax/make-request.

Lens for the `f` field from a [[Request]] record. See [[reacl-c-basics.ajax/make-request]].
sourceraw docstring

request-optionscljs

(request-options rec__14265__auto__)
(request-options data__14266__auto__ v__14267__auto__)

Lens for the options field from a Request record. See reacl-c-basics.ajax/make-request.

Lens for the `options` field from a [[Request]] record. See [[reacl-c-basics.ajax/make-request]].
sourceraw docstring

request-uricljs

(request-uri rec__14265__auto__)
(request-uri data__14266__auto__ v__14267__auto__)

Lens for the uri field from a Request record. See reacl-c-basics.ajax/make-request.

Lens for the `uri` field from a [[Request]] record. See [[reacl-c-basics.ajax/make-request]].
sourceraw docstring

request?cljs

(request? thing)

Is object a Request record? See reacl-c-basics.ajax/make-request.

Is object a `Request` record? See [[reacl-c-basics.ajax/make-request]].
sourceraw docstring

Responsecljs

source

response-ok?cljs

(response-ok? rec__14265__auto__)
(response-ok? data__14266__auto__ v__14267__auto__)

Lens for the ok? field from a Response record. See reacl-c-basics.ajax/make-response.

Lens for the `ok?` field from a [[Response]] record. See [[reacl-c-basics.ajax/make-response]].
sourceraw docstring

response-valuecljs

(response-value rec__14265__auto__)
(response-value data__14266__auto__ v__14267__auto__)

Lens for the value field from a Response record. See reacl-c-basics.ajax/make-response.

Lens for the `value` field from a [[Response]] record. See [[reacl-c-basics.ajax/make-response]].
sourceraw docstring

response?cljs

(response? thing)

Is object a Response record? See reacl-c-basics.ajax/make-response.

Is object a `Response` record? See [[reacl-c-basics.ajax/make-response]].
sourceraw docstring

show-response-valuecljs

(show-response-value resp f-ok & [f-error])
source

throw-response-errorcljs

(throw-response-error error)
source

TRACEcljs

(TRACE uri & [options])
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close