Liking cljdoc? Tell your friends :D

views.reagent.sente.server


default-event-msg-handlerclj

(default-event-msg-handler view-system {:keys [event id uid client-id] :as ev})

very basic Sente event handler that can be used with Sente's start-chsk-router! which makes sure on-close! 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-close! 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.
raw docstring

init!clj

(init! sente-chsk-map options)
(init! view-system sente-chsk-map options)

initializes the views system and adds Sente-specific configuration to it to enable the necessary hooks into views.reagent. this function acts as a direct replacement to calling views.core/init!, so are able to initialize both views and views.reagent by calling this function. the arguments and return value are the same as in views.core/init! so see that function for more information.

extra available options specific to views.reagent/sente:

:context-fn

  • a function that accepts an initial context map created by views.reagent and allows your application to add any info necessary to the context map passed to various view system functions (such as auth-fn, namespace-fn, etc).

: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.
initializes the views system and adds Sente-specific configuration to it to
enable the necessary hooks into views.reagent. this function acts as a direct
replacement to calling views.core/init!, so are able to initialize both views
and views.reagent by calling this function. the arguments and return value are
the same as in views.core/init! so see that function for more information.

extra available options specific to views.reagent/sente:

:context-fn
- a function that accepts an initial context map created by views.reagent and
  allows your application to add any info necessary to the context map passed
  to various view system functions (such as auth-fn, namespace-fn, etc).

: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.
raw docstring

on-close!clj

(on-close! view-system
           {:keys [event id uid client-id ring-req ?reply-fn] :as ev})

should be called when a client's Sente connection is closed. ev is the event map provided by Sente where id = :chsk/uidport-close.

should be called when a client's Sente connection is closed. ev is the event
map provided by Sente where id = :chsk/uidport-close.
raw docstring

on-receive!clj

(on-receive! view-system
             {:keys [event id uid client-id ring-req ?reply-fn] :as ev})

should be called whenever a Sente event is raised that is not a connection closed event (:chsk/uidport-close). ev is the event map provided by Sente for the event. 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 Sente event is raised that is *not* a connection
closed event (:chsk/uidport-close). ev is the event map provided by Sente
for the event. 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.
raw docstring

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

× close