(chsk-open-event? {:keys [event] :as ev})
returns true if the sente event is for a channel-socket state change to 'open' or 'connected'.
returns true if the sente event is for a channel-socket state change to 'open' or 'connected'.
(default-event-msg-handler sente-chsk-map {:keys [event id client-id] :as ev})
very basic Sente event handler that can be used with Sente's start-chsk-router! which makes sure on-open! and on-receive! are called when appropriate. if your application does not need to do any custom Sente event handling, then you can opt to use this event handler.
very basic Sente event handler that can be used with Sente's start-chsk-router! which makes sure on-open! and on-receive! are called when appropriate. if your application does not need to do any custom Sente event handling, then you can opt to use this event handler.
(init! sente-chsk-map & [options])
performs initial configuration necessary to hook Sente into views.reagent as the client/server messaging backend. should be called once on page-load after the Sente channel socket has been created (via make-channel-socket!).
extra available options specific to views.reagent/sente:
:use-default-sente-router?
performs initial configuration necessary to hook Sente into views.reagent as the client/server messaging backend. should be called once on page-load after the Sente channel socket has been created (via make-channel-socket!). extra available options specific to views.reagent/sente: :use-default-sente-router? - if set, enables the use of a default Sente event handler (set via Sente's start-chsk-router!). if your application does not need to respond to any Sente events itself, then you may wish to use this option.
(on-open! sente-chsk-map {:keys [event id client-id] :as ev})
should be called when a new Sente connection is established. ev is the event map provided by Sente where id = :chsk/state, and :open? = true. make sure to call this function on all connection open events, not just the first one.
should be called when a new Sente connection is established. ev is the event map provided by Sente where id = :chsk/state, and :open? = true. make sure to call this function on all connection open events, not just the first one.
(on-receive! sente-chsk-map {:keys [event id client-id] :as ev})
should be called whenever a new message is received by Sente from the server. ev is the event map provided by Sente where id = :chsk/recv. if this function returns true it means the received message was for views.reagent and your application code does not need to handle the event itself.
should be called whenever a new message is received by Sente from the server. ev is the event map provided by Sente where id = :chsk/recv. if this function returns true it means the received message was for views.reagent and your application code does not need to handle the event itself.
(send-fn sente-chsk-map data)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close