Fork me on GitHub
#om
<
2017-01-31
>
danielstockton09:01:56

@alex-glv I'm not convinced that stuff should be built in, people will have different routing requirements and the primitives are already there to support them. I think this is better served by other libs, such as compassus.

danielstockton11:01:11

However, I would really like the existing primitives (such as set-query!) to properly support datascript and other stores.

danielstockton11:01:21

I think to do that, the store should define a concrete interface. Perhaps it can already be done by implementing some abstractions that atoms are built on? I would be happy to work on a PR for this, with some guidance on how it would be accepted (@dnolen @anmonteiro).

denik13:01:28

has anyone tried om.next with cljsjs/react-motion?

drcode14:01:06

@denik yes, works great, let me forward you my shimmy

drcode14:01:28

@denik: First, add this dependency [cljsjs/react-motion "0.4.1-1"] Then you just need the following code:

(defn motion [atts thunk]
      (js/React.createElement js/ReactMotion.Motion (clj->js atts)
                              (fn [value]
                                  (thunk (js->clj value :keywordize-keys true)))))

(def spring js/ReactMotion.spring)
(def wobbly js/ReactMotion.presets.wobbly)
(def gentle js/ReactMotion.presets.gentle)
(def stiff js/ReactMotion.presets.stiff)

drcode14:01:09

@denik then you do something like:

(mo/motion {:defaultStyle {:left (if (:from-right (om/get-state this))
                                   -100
                                   100)}
            :style        {:left (mo/spring (:basic-info-left (om/get-state this)))}}
           (fn [value]
             ...))
Where value will have the animation value

anmonteiro23:01:35

@danielstockton I think the DataScript issue can be solved by putting & looking for queries in a place other than the app-state

anmonteiro23:01:45

we just need to find a suitable place to put them in