Liking cljdoc? Tell your friends :D

superstructor.re-frame.fetch-fx


->readercljs

(->reader reader-or-kw)

Wrap a normal keyword on a reader map (see response->header), and set a default json body reader.

Wrap a normal keyword on a reader map (see `response->header`), and
set a default json body reader.
sourceraw docstring

->seqcljs

(->seq x)

Returns x if x satisfies ISequential, otherwise vector of x.

Returns x if x satisfies ISequential, otherwise vector of x.
sourceraw docstring

->strcljs

(->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().
sourceraw docstring

abortcljs

(abort {:keys [request-id]})
source

abort-fxcljs

(abort-fx effect)
source

body-problem-handlercljs

(body-problem-handler {:keys [request-id envelope? on-failure]
                       :or {on-failure [:fetch-no-on-failure]}}
                      response
                      {:keys [reader-kw] :as _reader}
                      js-error)
source

body-success-handlercljs

(body-success-handler {:keys [request-id envelope? on-success on-failure]
                       :or {on-success [:fetch-no-on-success]
                            on-failure [:fetch-no-on-failure]}}
                      response
                      {:keys [reader-kw reader-fn] :as _reader}
                      js-body)
source

default-json-readercljs

source

default-text-readercljs

source

encode-kvcljs

(encode-kv k v)
source

fetchcljs

(fetch {:keys [url timeout params request-id envelope? on-request-id
               abort-signal]
        :as request
        :or {request-id (keyword (gensym "fetch-fx-"))}})

Initialise the request. Returns nil.

Initialise the request. Returns nil.
sourceraw docstring

fetch-fxcljs

(fetch-fx envelope? effect)
source

headers->jscljs

(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.
sourceraw docstring

js-error->problemcljs

(js-error->problem js-error)
source

js-headers->cljcljs

(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.
sourceraw docstring

js-response->cljcljs

(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.
sourceraw docstring

params->strcljs

(params->str params)

Returns a URI-encoded string of the params.

Returns a URI-encoded string of the params.
sourceraw docstring

request->js-initcljs

(request->js-init {:keys [method headers request-content-type body mode
                          credentials cache redirect referrer integrity]}
                  abort-signal)

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.
sourceraw docstring

request-id->js-abort-controllercljs

source

response->readercljs

(response->reader {:keys [response-content-types]} response)

Returns a reader map or the default-text-reader to use for the body of the response according to the Content-Type header. A reader map is one with 2 keys:

  • reader-kw: a keyword to indicate what js/Body method should be used.
  • reader-fn: a function that processes the js-body as required.
Returns a reader map or the `default-text-reader` to use for the body of the
response according to the Content-Type header.
A reader map is one with 2 keys:
- `reader-kw`: a keyword to indicate what js/Body method should be used.
- `reader-fn`: a function that processes the `js-body` as required.
sourceraw docstring

response-problem-handlercljs

(response-problem-handler {:keys [request-id envelope? on-failure]
                           :or {on-failure [:fetch-no-on-failure]}}
                          js-error)
source

response-success-handlercljs

(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.
sourceraw docstring

timeout-racecljs

(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.
sourceraw docstring

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

× close