Liking cljdoc? Tell your friends :D

ripley.live.protocols

Protocols for live components.

Protocols for live components.
raw docstring

Callbackcljprotocol

callback-conditionclj

(callback-condition this)

Return JS condition code for conditional callback invocation or nil

Return JS condition code for conditional callback invocation or nil

callback-debounce-msclj

(callback-debounce-ms this)

Return milliseconds how much this callback invocation should be debounced for, or nil if not debounced.

Return milliseconds how much this callback invocation should be debounced for, or nil if not debounced.

callback-fnclj

(callback-fn this)

Return the actual callback function to invoke.

Return the actual callback function to invoke.

callback-js-paramsclj

(callback-js-params this)

Return collection JS code fragments to get parameters

Return collection JS code fragments to get parameters

callback-on-failureclj

(callback-on-failure this)

Return JS function code to call when server callback has failed. The function will be called with the original arguments of the callback and an object describing the error.

Return JS function code to call when server callback has failed. The function will be called
with the original arguments of the callback and an object describing the error.

callback-on-successclj

(callback-on-success this)

Return JS function code to call when server callback has succeeded. The function will be called with the return value of the server side function (which must be JSON serializable).

Return JS function code to call when server callback has succeeded. The function will be called
with the return value of the server side function (which must be JSON serializable).
source

ConnectionCallbackscljprotocol

Protocol for callbacks on a live page connection.

Protocol for callbacks on a live page connection.

on-closeclj

(on-close this status)

Connection closed with status

Connection closed with status

on-openclj

(on-open this)

Connection opened.

Connection opened.

on-receiveclj

(on-receive this data)

Callback for data received. Data must be a string. Other types of messages are not supported.

Callback for data received.
Data must be a string. Other types of messages are not supported.
sourceraw docstring

LiveContextcljprotocol

deregister!clj

(deregister! this id)

Deregister a previously registered component by id. Returns nil. Live component should deregister once no more live updates are coming. When all live components on a page have been deregistered, the context and socket can be closed.

Deregister a previously registered component by id. Returns nil.
Live component should deregister once no more live updates are coming.
When all live components on a page have been deregistered, the context and socket
can be closed.

register!clj

(register! this source component opts)

Register new live component in this context. Must return id for component.

Register new live component in this context. Must return id for component.

register-callback!clj

(register-callback! this callback)

Register new callback. Must return callback id.

Register new callback. Must return callback id.

register-cleanup!clj

(register-cleanup! this cleanup-fn)

Register cleanup fn to run after the current live context client disconnects. All cleanup functions are run in the order they are registered and take no parameters.

Register cleanup fn to run after the current live context client disconnects.
All cleanup functions are run in the order they are registered and take no
parameters.

send!clj

(send! this payload)

Send command to connected client.

Send command to connected client.
source

Sourcecljprotocol

close!clj

(close! this)

Close this source and cleanup any server resources.

Close this source and cleanup any server resources.

current-valueclj

(current-value this)

Return the current value when first rendering a live component from this source. If this source is not immediate (doesn't have value until later), it should return nil or some application level marker value.

Avoid blocking as it will slow down page rendering.

Return the current value when first rendering a live component from this source.
If this source is not immediate (doesn't have value until later), it should
return nil or some application level marker value.

Avoid blocking as it will slow down page rendering.

listen!clj

(listen! this callback)

Add new listener callback for this source. When ever the source value changes, the listener will be called with the new value. The source is responsible for deduping values and not calling listeners again if another change has the same value as the last one.

Returns 0-arity function that will remove the listener when called.

Add new listener callback for this source. When ever the source value
changes, the listener will be called with the new value.
The source is responsible for deduping values and not calling listeners
again if another change has the same value as the last one.

Returns 0-arity function that will remove the listener when called.
source

Writablecljprotocol

write!clj

(write! this new-value)

Write new value for this source.

Write new value for this source.
source

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

× close