I have an application state
(def app-state (atom {:index 0 :some-list [1 2 3 4]}))
When next button is clicked, index is incremented and the corresponding item from the :some-list is displayed. Now I want to introduce an animation/effect during the transition from one item to another. How should I go about it in Om ?
regards
--
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 clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
Thanks. It worked!
Thanks heaps for all of your tutorials and work on Om. I've got a nice little clojurescript app with full undo/redo working with Om thanks to your tutorials and blog posts, and my goal for today is to work on animations.
As an alternative to the interval within IWillMount, has anyone successfully used the ReactCSSTransitionGroup (http://facebook.github.io/react/docs/animation.html) addon within Om? I'm a newcomer to both cljs and React, and I've unsuccessfully attempted to do something like:
(def css-trans-group (-> js/React (aget "addons") (aget "CSSTransitionGroup")))
(defn my-component [app owner]
(reify
om/IRender
(render [this]
(css-trans-group #js {:transitionName "example"}
(apply dom/div nil
(om/build-all palette-entry-component palette))))))
Is this sort of approach reasonable within Om? Sorry in advance for the probably silly question!
-jack
Haven't had time to write the corresponding Om stuff yet, but the concept is very simple. Basically you just want to define an interpolator between your start and end value, and then write a function that gets called faster than request animation frame and then invokes an interpolator with 0-1 and calls set-state! or transact! with the result.
Not sure if any of this is helpful at all...