(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.
(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.
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.
(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]].
(delivery-job-id rec__12239__auto__)
(delivery-job-id data__12240__auto__ v__12241__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]].
(delivery-job-info rec__12239__auto__)
(delivery-job-info data__12240__auto__ v__12241__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]].
(delivery-job-request rec__12239__auto__)
(delivery-job-request data__12240__auto__ v__12241__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]].
(delivery-job-response rec__12239__auto__)
(delivery-job-response data__12240__auto__ v__12241__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]].
(delivery-job-status rec__12239__auto__)
(delivery-job-status data__12240__auto__ v__12241__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]].
(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]].
(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.
(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.
(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).
(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 yetfalse
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.
(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
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]]
(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]]
(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]]
(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.
(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)`.
(request-f rec__12239__auto__)
(request-f data__12240__auto__ v__12241__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]].
(request-options rec__12239__auto__)
(request-options data__12240__auto__ v__12241__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]].
(request-uri rec__12239__auto__)
(request-uri data__12240__auto__ v__12241__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]].
(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]].
(response-ok? rec__12239__auto__)
(response-ok? data__12240__auto__ v__12241__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]].
(response-value rec__12239__auto__)
(response-value data__12240__auto__ v__12241__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]].
(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]].
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close