Morf provides syntactic sugar over reagent atoms and reactions, either inside a
component for component-local state, using with-form
, or at the top level
for shared state with deform
.
Morf provides syntactic sugar over reagent atoms and reactions, either inside a component for component-local state, using [[with-form]], or at the top level for shared state with [[deform]].
(deform binding & more)
Define a new 'form', bound to the given symbol (var) at the top level. The form itself is a reaction and can be dereferenced. Any symbols in the form starting with ? or ! are bound to ratoms, and can be individually set or read.
Use :init
to specify initial values for the ratoms.
Define a new 'form', bound to the given symbol (var) at the top level. The form itself is a reaction and can be dereferenced. Any symbols in the form starting with ? or ! are bound to ratoms, and can be individually set or read. Use `:init` to specify initial values for the ratoms.
(deform-once binding formdef & opts)
Like deform
, but expands to a defonce
instead of a def
. Good for
maintaining state across reloads.
Like [[deform]], but expands to a `defonce` instead of a `def`. Good for maintaining state across reloads.
(with-form [binding formdef & {:keys [init]}] & body)
Define a new 'form' to be used within the scope of the block, typically used inside a Reagent component. The form itself is a reaction and can be dereferenced. Any symbols in the form starting with ? or ! are bound to ratoms, and can be individually set or read.
Define a new 'form' to be used within the scope of the block, typically used inside a Reagent component. The form itself is a reaction and can be dereferenced. Any symbols in the form starting with ? or ! are bound to ratoms, and can be individually set or read.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close