(->seq x)
Returns x if x satisfies ISequential, otherwise vector of x.
Returns x if x satisfies ISequential, otherwise vector of x.
(->str x)
Returns the name String of x if x is a symbol or keyword, otherwise x.toString().
Returns the name String of x if x is a symbol or keyword, otherwise x.toString().
(body-problem-handler {:as request
:keys [request-id on-failure]
:or {on-failure [:fetch-no-on-failure]}}
response
reader-kw
js-error)
(body-success-handler {:as request
:keys [request-id on-success on-failure]
:or {on-success [:fetch-no-on-success]
on-failure [:fetch-no-on-failure]}}
response
reader-kw
js-body)
(fetch {:keys [url timeout params request-id on-request-id]
:as request
:or {request-id (keyword (gensym "fetch-fx-"))}})
Initialise the request. Returns nil.
Initialise the request. Returns nil.
(headers->js headers)
Returns a new js/Headers JavaScript object of the ClojureScript map of headers.
Returns a new js/Headers JavaScript object of the ClojureScript map of headers.
(js-headers->clj js-headers)
Returns a new ClojureScript map of the js/Headers JavaScript object.
Returns a new ClojureScript map of the js/Headers JavaScript object.
(js-response->clj js-response)
Returns a new ClojureScript map of the js/Response JavaScript object.
Returns a new ClojureScript map of the js/Response JavaScript object.
(params->str params)
Returns a URI-encoded string of the params.
Returns a URI-encoded string of the params.
(request->js-init {:keys [method headers request-content-type body mode
credentials cache redirect referrer integrity]
:as request}
js-controller)
Returns an init options js/Object to use as the second argument to js/fetch.
Returns an init options js/Object to use as the second argument to js/fetch.
(response->reader-kw {:keys [response-content-types]} response)
Returns a keyword of the type of reader to use for the body of the response according to the Content-Type header.
Returns a keyword of the type of reader to use for the body of the response according to the Content-Type header.
(response-problem-handler {:as request
:keys [request-id on-failure]
:or {on-failure [:fetch-no-on-failure]}}
js-error)
(response-success-handler request js-response)
Reads the js/Response JavaScript Object stream to completion. Returns nil.
Reads the js/Response JavaScript Object stream to completion. Returns nil.
(timeout-race js-promise timeout)
Returns a js/Promise JavaScript object that is a race between another js/Promise JavaScript object and timeout in ms if timeout is not nil, otherwise js-promise.
Returns a js/Promise JavaScript object that is a race between another js/Promise JavaScript object and timeout in ms if timeout is not nil, otherwise js-promise.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close