Liking cljdoc? Tell your friends :D

tuck.remoting

clj

Define Tuck events that are sent to the server.

Define Tuck events that are sent to the server.
raw docstring

connect!cljs

(connect! ws-url app-atom on-connect)
source

connectioncljs

source

define-client-eventcljmacro

(define-client-event event-record-name)
(define-client-event event-record-name constructor)

Define event record that the server can send to the client. The must be previously defined record type.

Define event record that the server can send to the client.
The must be previously defined record type.
sourceraw docstring

define-server-eventcljmacro

(define-server-event event-record-name options)

Define an event record that is automatically sent to the server.

  • event-record-name must be a symbol defining the event name.
  • options is a map of parameters

The event is sent to the server. If the server is expected to send some other event as a reply to this event, a timeout may be specified. By default, no timeout is applied.

Each event has an id (sequence number). If event-id-path is set, the id of the sent event will be assoc'ed to the app state at that path. This is useful for example for showing a loading indicator in the client.

Supported options:

  • timeout number of milliseconds to wait for server to send a response
  • on-timeout a symbol denoting an event record to send if no response is received
  • event-id-path a vector denoting a path in the app state to set the event id to
Define an event record that is automatically sent to the server.

- `event-record-name` must be a symbol defining the event name.
- `options` is a map of parameters

The event is sent to the server. If the server is expected to send some other
event as a reply to this event, a timeout may be specified. By default, no timeout
is applied.

Each event has an id (sequence number). If `event-id-path` is set, the id of the
sent event will be assoc'ed to the app state at that path. This is useful for
example for showing a loading indicator in the client.

Supported options:

- `timeout` number of milliseconds to wait for server to send a response
- `on-timeout` a symbol denoting an event record to send if no response is received
- `event-id-path` a vector denoting a path in the app state to set the event id to

sourceraw docstring

event-idcljs

source

initialize-client!cljs

(initialize-client! ws-url app-atom on-connect)

Initialize Tuck remoting client. Takes the websocket URL and the app state atom to apply received events against.

Must be called before any events can be sent.

Initialize Tuck remoting client. Takes the websocket URL and the app state atom
to apply received events against.

Must be called before any events can be sent.
sourceraw docstring

map->eventclj/smultimethod

source (clj)source (cljs)

send-event!cljs

(send-event! event)

Send event to Tuck remoting WS server. Returns event id.

Send event to Tuck remoting WS server.
Returns event id.
sourceraw docstring

ServerEventcljprotocol

process-eventclj

(process-event this client server-state)

Process this event received from the client and return new server state. client is map describing the client who sent this event. context is the user defined server context

Process this event received from the client and return new server state.
`client` is map describing the client who sent this event.
`context` is the user defined server context
source

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

× close