Liking cljdoc? Tell your friends :D

bangmod.http-api.internal


a-datacljs

source

a-reactionscljs

source

api-specscljs

source

auth-token-providercljs

source

defapicljs

(defapi api-name options endpoints-spec)
source

executecljs

(execute api-name endpoint-name opts)
source

make-reactioncljs

(make-reaction api-name)
source

set-auth-token-provider!cljs

(set-auth-token-provider! f)

Registers a 0-arg fn that returns the current access token (or nil).

Registers a 0-arg fn that returns the current access token (or nil).
sourceraw docstring

subscribecljs

(subscribe api-name
           endpoint-name
           {:keys [path-params params on-open on-message on-error] :as _opts})

Opens an SSE subscription against an endpoint declared :method :sse.

Reconnect is owned here, on a readyState split: CONNECTING means EventSource is already retrying on the server's retry: field, so we only report the drop; CLOSED means it gave up — which per the HTML spec is what a non-200 status or a wrong Content-Type produces, i.e. our 401 and our 503 — so we re-open on a backoff, re-reading the token from auth-token-provider at open time, every time.

Opens an SSE subscription against an endpoint declared `:method :sse`.

Reconnect is owned here, on a readyState split: `CONNECTING` means EventSource is already
retrying on the server's `retry:` field, so we only report the drop; `CLOSED` means it
gave up — which per the HTML spec is what a non-200 status or a wrong Content-Type
produces, i.e. our 401 and our 503 — so we re-open on a backoff, re-reading the token
from `auth-token-provider` at open time, every time.
sourceraw docstring

unsubscribe!cljs

(unsubscribe! handle)

Closes the EventSource and cancels any pending reconnect.

Closes the EventSource and cancels any pending reconnect.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close