Liking cljdoc? Tell your friends :D
ClojureScript only.

haslett.client

A namespace for opening WebSockets in ClojureScript.

A namespace for opening WebSockets in ClojureScript.
raw docstring

closecljs

(close stream)

Close a stream opened by connect.

Close a stream opened by connect.
sourceraw docstring

connectcljs

(connect url)
(connect url options)

Create a WebSocket to the specified URL, and returns a 'stream' map of four keys:

:socket - contains the WebSocket object :close-status - a promise channel that contains the final close status :in - a core.async channel to read from :out - a core.async channel to write to

Takes the following options:

:format - a formatter from haslett.format :in - a custom channel to use as the reader :out - a custom channel to use as the writer :protocols - passed to the WebSocket, a vector of protocol strings :binary-type - passed to the WebSocket, may be :blob or :arraybuffer :close-chan? - true if channels should be closed if WebSocket is closed (defaults to true)

The WebSocket may either be closed directly, or by closing the stream's :sink channel.

Create a WebSocket to the specified URL, and returns a 'stream' map of four
keys:

  :socket       - contains the WebSocket object
  :close-status - a promise channel that contains the final close status
  :in           - a core.async channel to read from
  :out          - a core.async channel to write to

Takes the following options:

  :format      - a formatter from haslett.format
  :in          - a custom channel to use as the reader
  :out         - a custom channel to use as the writer
  :protocols   - passed to the WebSocket, a vector of protocol strings
  :binary-type - passed to the WebSocket, may be :blob or :arraybuffer
  :close-chan? - true if channels should be closed if WebSocket is closed
                 (defaults to true)

The WebSocket may either be closed directly, or by closing the
stream's :sink channel.
sourceraw docstring

connected?cljs

(connected? {:keys [close-status]})

Return true if the stream is currently connected.

Return true if the stream is currently connected.
sourceraw docstring

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

× close