This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # bangalore-clj (1)
- # beginners (27)
- # boot (29)
- # clara (4)
- # cljs-dev (10)
- # cljsrn (2)
- # clojure (36)
- # clojure-austin (9)
- # clojure-brasil (4)
- # clojure-france (10)
- # clojure-nl (2)
- # clojure-quebec (1)
- # clojure-russia (10)
- # clojure-spec (50)
- # clojure-uk (6)
- # clojurescript (82)
- # clr (4)
- # core-async (5)
- # core-logic (3)
- # cursive (4)
- # datomic (1)
- # devcards (1)
- # figwheel (1)
- # leiningen (2)
- # lumo (6)
- # off-topic (23)
- # om (39)
- # onyx (3)
- # planck (2)
- # re-frame (5)
- # reagent (24)
- # specter (1)
- # test-check (3)
@sova: that's a solution to a component not updating. My issue is the component updates milliseconds too late, causing a flicker. :(
@anmonteiro @sova I seem to have gotten it to work.
(p/reconcile! reconciler) seems to do the job. (not even
(.reconciler! reconciler) for some reason.)
probably because the name is munged.
(.reconcile_BANG_ reconciler) would probably do it
@levitanong hrm, so now that you discovered that works, I may have a less hacky solution for you :slightly_smiling_face:
so Om Next has this async rendering loop, which on browsers is implemented through
@levitanong you can override the function that queues the render loop by binding
requestAnimationFrame exists on react native though. https://facebook.github.io/react-native/docs/timers.html)
and i suppose I could override
*raf*, and somehow unbind it later on to bring it back to asynchronous rendering?
*raf* works! Unsetting it doesn’t seem so easy though, because it has to be unset after the rendering finishes.
oh right, I’ve been putting them in the parser, but now it’s not necessary since i’m not touching the reconciler.
was wondering though, if
(binding [om/*raf* (fn [f] (f))] (p/schedule-render! reconciler)) work
I've been experimenting with the "raf" npm lib and om inside a dev-om-card to implement a TimeLoop component and it works better than I expeced! I still don't fully understand how requestAnimationFrameworks works too I just copied an example from gl-react to build my om component...
I too used react-set-state! to bypass om rendering loop but I ended up mutating the :timeloop/tick state that my components who need to animate based on tick are already querying that same :timeloop so maybe it's wrong to do it using requestAnimFrame. .? I would enjoy seeing some related code... :slightly_smiling_face:
request animation frame calls a function when the machine says it’s ready to render a new frame.
this allows the program to keep going without slowing down due to expensive render jobs
Yeah I understand that much but I'm still confused as to how it works with om next rendering loop. If I have a TimeLoop component that mutate say :tick and other components should do something when tick changes (possibly render) then the reconciler will triger rendering for the corresponding component by walking it's om-root... when I use om/react-set-state! and raf, I bypass that and only do that when the browser feels like it (based on free cpu and refresh rate etc..) ?
but I confused things a little and have the "raf" callback do an om/transact! on the timeloop :tick so that probably trigers the om-root rendering through om next as well I think...
I think I need two kind of timeloop for my games... One like that using raf running at 30-60fps (if cpu can keep up) for my visual effects and one using core.async that run at steady 5-10 fps for my game logic.