Liking cljdoc? Tell your friends :D
ClojureScript only.

wscljs.client


closecljs

(close socket)

Closes the socket connection.

Closes the socket connection.
sourceraw docstring

createcljs

(create url {:keys [on-open on-message on-close] :as handler-map})

Starts a websocket connection and returns it.

Takes the following arguments:

url => the websocket url handler-map => a hashmap containing handler functions mapping to:

           - :on-open    => called when opening a socket connection
           - :on-message => called when recieving message on the socket
           - :on-close   => called when closing a socket connection

Usage:

(require '[wscljs.client :as ws] '[wscljs.format :as fmt])

(def socket (ws/create "ws://...." handler-map))

(ws/send socket data fmt/json)

Starts a websocket connection and returns it.

Takes the following arguments:

url         => the websocket url
handler-map => a hashmap containing handler functions mapping to:

               - :on-open    => called when opening a socket connection
               - :on-message => called when recieving message on the socket
               - :on-close   => called when closing a socket connection

Usage:

(require '[wscljs.client :as ws]
         '[wscljs.format :as fmt])


(def socket (ws/create "ws://...." handler-map))

(ws/send socket data fmt/json)
sourceraw docstring

sendcljs

(send socket data)
(send socket data format)

Sends data over socket in the specified format.

Sends data over socket in the specified format.
sourceraw docstring

statuscljs

(status socket)
source

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

× close