Am Mittwoch, 12. März 2014 17:47:34 UTC+1 schrieb David Nolen: > What is :validate? A string? > > > If you implemented ICloneable for String please remove it. This is only for > explication/demonstration purposes in the tutorial.
OK, there is the part I didn't understand... Yes, I still had the String parts from the tutorial in this. Now I don't even need to deref the state, I can just do (defmulti handle-change (fn [e state owner] (:validate state))) Coming to ClojureScript without Javascript background I just glanced over this part of the tutorial, my bad. Thanks David! / Mathias > > > > David > > > > > On Wed, Mar 12, 2014 at 12:44 PM, Mathias Picker <[email protected]> wrote: > > Am Mittwoch, 12. März 2014 17:07:44 UTC+1 schrieb Mathias Picker: > > > > > > Hi all, > > > > > > I'm trying to understand om and build a simple input field with validation, > > hacked together from the tutorial. > > > > I found a way around this: using (str (:validate entry)) in init-state works > just fine... > > > > > > > > > > > (defn input-view [entry owner] > > > (reify > > > om/IInitState > > > (init-state [this] > > > {:text (:value entry) > > > :hint (:hint entry) > > > > Change this: > > > > :validate (:validate entry)}) > > > > to this: > > > :validate (str (:validate entry))}) > > > > and everything works as I expected. > > > > So (:validate entry) gives me a cursor, which I can only use in the render > phase. And in that render phase, I can simply do (str (:validate entry)) to > turn it into a string, which I can use outside the render phase. Correct? > > > > > > > Thanks, Mathias > > > > > > -- > > Note that posts from new members are moderated - please be patient with your > first post. > > --- > > You received this message because you are subscribed to the Google Groups > "ClojureScript" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > > To post to this group, send email to [email protected]. > > Visit this group at http://groups.google.com/group/clojurescript. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
