Liking cljdoc? Tell your friends :D

citrus.core


broadcast!clj/s≠

clj
(broadcast! _ _ & _)

dummy broadcast!

dummy broadcast!
cljs
(broadcast! reconciler event & args)

Invoke an event on all controllers asynchronously

(citrus/broadcast! reconciler :init)

Arguments

reconciler - an instance of Reconciler event - a dispatch value of a method defined in the controller args - arguments to be passed into the controller

Invoke an event on all controllers asynchronously

  (citrus/broadcast! reconciler :init)

Arguments

  reconciler - an instance of Reconciler
  event      - a dispatch value of a method defined in the controller
  args       - arguments to be passed into the controller
source (clj)source (cljs)raw docstring

broadcast-sync!clj/s≠

clj
(broadcast-sync! _ _ & _)

dummy broadcast-sync!

dummy broadcast-sync!
cljs
(broadcast-sync! reconciler event & args)

Invoke an event on all controllers synchronously

(citrus/broadcast! reconciler :init)

Arguments

reconciler - an instance of Reconciler event - a dispatch value of a method defined in the controller args - arguments to be passed into the controller

Invoke an event on all controllers synchronously

  (citrus/broadcast! reconciler :init)

Arguments

  reconciler - an instance of Reconciler
  event      - a dispatch value of a method defined in the controller
  args       - arguments to be passed into the controller
source (clj)source (cljs)raw docstring

defhandlercljmacro

(defhandler & args)

Create event handler with optional meta data

(citrus/defhandler control :load {:cofx [[:local-storage :key]]} [event args state coeffects] {:state (:local-storage coeffects)})

Create event handler with optional meta data

(citrus/defhandler control :load
  {:cofx [[:local-storage :key]]}
  [event args state coeffects]
  {:state (:local-storage coeffects)})
sourceraw docstring

dispatch!clj/s≠

clj
(dispatch! _ _ _ & _)

dummy dispatch!

dummy dispatch!
cljs
(dispatch! reconciler controller event & args)

Invoke an event on particular controller asynchronously

(citrus/dispatch! reconciler :users :load "id")

Arguments

reconciler - an instance of Reconciler controller - name of a controller event - a dispatch value of a method defined in the controller args - arguments to be passed into the controller

Invoke an event on particular controller asynchronously

  (citrus/dispatch! reconciler :users :load "id")

Arguments

  reconciler - an instance of Reconciler
  controller - name of a controller
  event      - a dispatch value of a method defined in the controller
  args       - arguments to be passed into the controller
source (clj)source (cljs)raw docstring

dispatch-sync!clj/s≠

clj
(dispatch-sync! _ _ _ & _)

dummy dispatch-sync!

dummy dispatch-sync!
cljs
(dispatch-sync! reconciler controller event & args)

Invoke an event on particular controller synchronously

(citrus/dispatch! reconciler :users :load "id")

Arguments

reconciler - an instance of Reconciler controller - name of a controller event - a dispatch value of a method defined in the controller args - arguments to be passed into the controller

Invoke an event on particular controller synchronously

  (citrus/dispatch! reconciler :users :load "id")

Arguments

  reconciler - an instance of Reconciler
  controller - name of a controller
  event      - a dispatch value of a method defined in the controller
  args       - arguments to be passed into the controller
source (clj)source (cljs)raw docstring

reconcilerclj/s≠

clj
(reconciler {:keys [state resolvers]})

Accepts a hash of :state atom & :resolvers hash of subscription resolvers where keys are subscription path vectors and values are data resolving functions

{:state (atom {}) :resolvers {[:counter] fetch-counter}}

Returns a hash of resolvers and state atom which will be populated with resolved subscriptions data during rendering

Accepts a hash of `:state` atom & `:resolvers` hash of subscription resolvers where keys are subscription path vectors and values are data resolving functions

  {:state (atom {})
   :resolvers {[:counter] fetch-counter}}

Returns a hash of `resolvers` and `state` atom which will be populated with resolved subscriptions data during rendering
cljs
(reconciler {:keys [state controllers effect-handlers co-effects batched-updates
                    chunked-updates]
             :or {batched-updates -default-batched-updates}}
            &
            {:as options})

Creates an instance of Reconciler

(citrus/reconciler {:state (atom {}) :controllers {:counter counter/control} :effect-handlers {:http effects/http} :batched-updates {:schedule-fn f :release-fn f'} :chunked-updates f})

Arguments

config - a map of state - app state atom controllers - a hash of state controllers effect-handlers - a hash of effects handlers batched-updates - a hash of two functions used to batch reconciler updates, defaults to {:schedule-fn js/requestAnimationFrame :release-fn js/cancelAnimationFrame} chunked-updates - a function used to divide reconciler update into chunks, doesn't used by default

Returned value supports deref, watches and metadata. The only supported option is :meta

Creates an instance of Reconciler

  (citrus/reconciler {:state (atom {})
                      :controllers {:counter counter/control}
                      :effect-handlers {:http effects/http}
                      :batched-updates {:schedule-fn f :release-fn f'}
                      :chunked-updates f})

Arguments

  config              - a map of
    state             - app state atom
    controllers       - a hash of state controllers
    effect-handlers   - a hash of effects handlers
    batched-updates   - a hash of two functions used to batch reconciler updates, defaults to
                        `{:schedule-fn js/requestAnimationFrame :release-fn js/cancelAnimationFrame}`
    chunked-updates   - a function used to divide reconciler update into chunks, doesn't used by default

Returned value supports deref, watches and metadata.
The only supported option is `:meta`
source (clj)source (cljs)raw docstring

subscriptionclj/s≠

clj
(subscription reconciler path)
(subscription {:keys [state resolvers]} path reducer)

Create a subscription to state updates

(citrus/subscription reconciler [:users 0] (juxt [:fname :lname]))

Arguments

reconciler - reconciler hash path - a vector which describes a path into resolver's result value reducer - an aggregate function which computes a materialized view of data behind the path

Create a subscription to state updates

  (citrus/subscription reconciler [:users 0] (juxt [:fname :lname]))

Arguments

  reconciler - reconciler hash
  path       - a vector which describes a path into resolver's result value
  reducer    - an aggregate function which computes a materialized view of data behind the path
cljs
(subscription reconciler path)
(subscription reconciler path reducer)

Create a subscription to state updates

(citrus/subscription reconciler [:users 0] (juxt [:fname :lname]))

Arguments

reconciler - an instance of Reconciler path - a vector which describes a path into reconciler's atom value reducer - an aggregate function which computes a materialized view of data behind the path

Create a subscription to state updates

  (citrus/subscription reconciler [:users 0] (juxt [:fname :lname]))

Arguments

  reconciler - an instance of Reconciler
  path       - a vector which describes a path into reconciler's atom value
  reducer    - an aggregate function which computes a materialized view of data behind the path
source (clj)source (cljs)raw docstring

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

× close