Skip to content

Instantly share code, notes, and snippets.

@krisajenkins
Created December 15, 2015 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krisajenkins/5edd2768d4a2d43fe027 to your computer and use it in GitHub Desktop.
Save krisajenkins/5edd2768d4a2d43fe027 to your computer and use it in GitHub Desktop.
(defn stateful-view []
(let [!form (reagent/atom {:name nil})]
(fn [ui-channel view-arg-1 view-arg-2]
[:form
[:input {:defaultValue (-> !form deref :name)
:onChange #(swap! !form assoc :name (.. % target value))}]])))
(defn regular-view
[ui-channel app]
[:div
...
(with-meta [stateful-view ui-channel arg1 arg2]
{:key :somethingsensible})])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment