Liking cljdoc? Tell your friends :D

shadow.xhr

FIXME: rewrite to using promises, since closure is deprecating result

FIXME: rewrite to using promises, since closure is deprecating result
raw docstring

as-urlcljs

(as-url input)
source

auto-transformcljs

(auto-transform req)
source

chancljs

(chan method url)
(chan method url data)
(chan method url data {:keys [events upload body-only] :as options})

creates a channel and performs xhr request like (chan :GET "/something")

accepts url as string or [url params]

this channel will receive one message [status body req] on load loadend will close the result channel, so you will get nil results on request errors/timeouts

use options hash to pass in extra channels

(chan :POST "/something" some-data {:events chan-or-map :upload chan-or-map})

when given a chan that channels receives messages in form of [event-type event-data req] when given a map a channel is expected for each eventtype and will receive [event-data req] {:timeout some-chan}, if no channel for a given event is present, no message is sent

event types are :loadstart :progress :abort :error :timeout :loadend :load (see xhr spec) only exception is that status >= 500 does not return a result and produces an error event instead

creates a channel and performs xhr request like (chan :GET "/something")

accepts url as string or [url params]

this channel will receive one message [status body req] on load
loadend will close the result channel, so you will get nil results on request errors/timeouts

use options hash to pass in extra channels

(chan :POST "/something" some-data {:events chan-or-map
                                      :upload chan-or-map})

when given a chan that channels receives messages in form of [event-type event-data req]
when given a map a channel is expected for each eventtype and will receive [event-data req]
{:timeout some-chan}, if no channel for a given event is present, no message is sent

event types are :loadstart :progress :abort :error :timeout :loadend :load (see xhr spec)
only exception is that status >= 500 does not return a result and produces an error event instead
sourceraw docstring

content-transformscljs

source

e->datacljs

(e->data e)
source

event-handlercljs

(event-handler req events event-type)
source

goog-keyscljs

source

make-request-optionscljs

(make-request-options options)
source

make-urlcljs

(make-url url params)
source

register-transformcljs

(register-transform content-type transform-fn)
source

requestcljs

(request method url)
(request method url data)
(request method url data options)
source

request-error?cljs

(request-error? status)
source

request-ok?cljs

(request-ok? status)
source

result-chaincljs

(result-chain res handler)
source

result-combinecljs

(result-combine & results)
source

result-errorcljs

(result-error res callback)
source

result-immediatecljs

(result-immediate value)
source

result-success?cljs

(result-success? res)
source

result-valuecljs

(result-value res)
source

result-wait-on-successcljs

(result-wait-on-success res callback)
source

transform-request-bodycljs

(transform-request-body data)
source

uploadcljs

(upload url file & events)
source

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

× close