Fork me on GitHub

hi i have a fairly simply problem - i’m looking at a reagent piece of code where they use session/put and session/get with secretary to store the current page they’re on


how can i do the same with om? store it in app-state?


yes, or set-query!, I mean there are various ways to solve this. One idea, is to change the queries of the root component depending on page you are on and have some transactor on page change, maybe trough bidi or secretary.


Hi. What is currently the preferred way to update an application's state with data from outside the om scope (e.g. websocket). I think I have read somewhere that you should use! but when I use this no new render is scheduled. I could also use! but I think I've read somewhere that this is not the preferred route.


cb in this case returns the function! and should alter the state and cause a re-render. The only reason a re-render wouldn’t happen is if a re-render is not needed because the state didn’t change for the currently mounted components.


@hlolli: for realtime high performance stuff usually best to work outside of om/react


@selfsame ok good to know, I may look into just declare muteable js variable. But this example here is update-state! on every beat, causing the gray areas to light up. (open this with google chrome and wait 1 min for it to load, also the crackling sound is something I'm fixing as I write this). But this are slow enough updates as not to cause too much load, but I may want to send different signals, but good for now.


neat! that might be lightweight enough to do with update-state!, I was imagining an audio visualizer not a sequencer 🙂