(elm {:keys [model events view]})
Creates elm-style component. Define a model, events, and view function. The point is the model is local, but can be watched & updated externally
Usage: Model: the initial model state Events: a map of k/v pairs (k is keyword, v is fn : model -> model) to dispatch updates to the model View: function returning a Form-1 or Form-3 component. DOES NOT return a Form-2 component function! if you want to do this, reference a new Form-2 component within the view fn. TODO enable specifying a validation fn for the model
Create elm component by defining a new function and returning a call to elm
as a FUNCTION
(not as a component). Then, use the resulting component.
The resulting component should be entirely insulated from knowledge of the outside the world. It has successfully lived life under a rock. It can now be used as a library.
When you pass the :model prop into the resulting component, if the :raf
key in the externally passed
in model is greater than the :raf
key in the local state, the local state will update.
When you pass the :watch-model prop into the resulting component, it will be called each time the model changes with the value of the model
Creates elm-style component. Define a model, events, and view function. The point is the model is local, but can be watched & updated externally Usage: Model: the initial model state Events: a map of k/v pairs (k is keyword, v is fn : model -> model) to dispatch updates to the model View: function returning a Form-1 or Form-3 component. DOES NOT return a Form-2 component function! if you want to do this, reference a new Form-2 component within the view fn. TODO enable specifying a validation fn for the model Create elm component by defining a new function and returning a call to `elm` as a FUNCTION (not as a component). Then, use the resulting component. The resulting component should be entirely insulated from knowledge of the outside the world. It has successfully lived life under a rock. It can now be used as a library. When you pass the :model prop into the resulting component, if the `:raf` key in the externally passed in model is greater than the `:raf` key in the local state, the local state will update. When you pass the :watch-model prop into the resulting component, it will be called each time the model changes with the value of the model
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close