Cool, that makes sense.  Let me know if you run into any issues with schema
or have feedback -- the cljs side is unfortunately less battle-tested than
clj unfortunately.


On Tue, Dec 17, 2013 at 12:01 PM, Travis Vachon <notifications@github.com>wrote:

> In src/cljs/parseapp_cljs/parse.cljs:
>
> > @@ -39,6 +82,23 @@
> >  (defn object-id [obj]
> >    (.-id obj))
> >
> > +(defn add-validator [methods options]
> > +  (if (:schema options)
> > +    [(assoc methods :validate
> > +            (fn [attrs opts]
> > +              (try
> > +                (schema/validate (:schema options) (attrs->clj attrs :keywordize-keys true))
> > +                false
> > +                (catch :default e
> > +                  e))))
>
> ah - it looks like check just returns a map and validate actually wraps it
> up as an exception - I want to return an exception to parse, so I'd be
> duplicating everything in validate except the throw so I think I'll stick
> with this unless try..catch turns out to be way less performant
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/utahstreetlabs/parseapp-cljs/pull/6/files#r8415179>
> .
>