Liking cljdoc? Tell your friends :D

bangmod.http-api.internal


a-datacljs

source

a-reactionscljs

source

api-specscljs

source

auth-token-injectorcljs

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-injector!cljs

(set-auth-token-injector! f)

Registers (fn [request token] -> request); nil restores the Bearer default.

Registers `(fn [request token] -> request)`; nil restores the Bearer default.
sourceraw docstring

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 events]
            :as _opts})

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

The stream is a fetch whose body is read as it arrives and parsed by sse/feed. Each (re)open rebuilds the request, so the token is re-read from auth-token-provider and put on by the registered injector every time. What happens next is decided by sse/response-action: 200 + text/event-stream opens; a 401 token-stale reloads the token and re-opens; any other 401 ends the session (the unauthorized handler, no re-open); anything else — another status, a network error, the stream ending — re-opens on the backoff, never faster than the server's retry:.

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

The stream is a `fetch` whose body is read as it arrives and parsed by `sse/feed`. Each
(re)open rebuilds the request, so the token is re-read from `auth-token-provider` and put
on by the registered injector every time. What happens next is decided by
`sse/response-action`: 200 + text/event-stream opens; a 401 `token-stale` reloads the
token and re-opens; any other 401 ends the session (the unauthorized handler, no
re-open); anything else — another status, a network error, the stream ending — re-opens
on the backoff, never faster than the server's `retry:`.
sourceraw docstring

unsubscribe!cljs

(unsubscribe! handle)

Aborts the stream's connection and cancels any pending reconnect. Anything that is not a Subscription — the reaction execute returns for a plain request, nil — is a no-op, so a component can unsubscribe! whatever execute gave it without knowing the method.

Aborts the stream's connection and cancels any pending reconnect. Anything that is not a
`Subscription` — the reaction `execute` returns for a plain request, nil — is a no-op, so
a component can `unsubscribe!` whatever `execute` gave it without knowing the method.
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