Fork me on GitHub

having trouble triggering a rerendering a sibling component after a mutation. See the comment below

(om/transact! this `[(face/update {:face ~id :background ~(rc)})
                                          [:faces/by-id ~id]]) ;; I want to update the component that has this ident but its in a different path in the UI tree


is it possible for an user to check app-state through the client console?


what kind of things are not safe to store in the application state?


@krchia: I've stored core.async channels and two types of dates (google and Javascript) as data in app-state. I'm not really sure what kind of data couldn't be stored in application state. Did you have some kind of complex data type in mind?


@cjmurphy this is going to make me sound dumb, but i was thinking of things you’ll normally store in a ring session key


As far as checking app state through the client console you can just @reconciler. But I prefer to have state be checked for me using


i guess what i’m really asking is about the difference between storing stuff in ring sessionstore and om app-state


I can't see why there would be a problem.


(cljs.pprint/pprint @reconciler) in the render of your root component (or from a button or something) good for debugging.


the way this project does is, he just stores a keyword :auth/success in om app-state


You can store keywords in your app state for sure!


would sensitive data be safe in there?


sorry, i’m learning both web security and om at the same time, so my questions might not make sense


I'm a bit the same so hesitant to answer security questions.


i mean the om app-state lives on the client right? is it possible for a malicious party to manipulate it?


maybe i haven’t done enough homework to properly formulate questions yet


No I think its a good question, but not a show stopper. Of course can be encrypted. I've started to use sente as well.


The answer will be the same for Reagent. https probably the best thing if you really need security. I read it is very easy with sente - just turn it on and it works.


say if you authenticated through websockets and you store the session information on the app-state


would everything be reloaded if you went to another url?


My experience (which is limited) is that session does not need to be stored anywhere. It just kind of flows back and forth from client to server.


I'm relatively new to web programming - that was my recent discovery.


Good questions - maybe ask again on Monday. 😜


and in between, a lot of reading simple_smile


thanks for entertaining my questions


@krchia: Anything you send to the client can be seen by the (potentially bad) client. Even if you don't display it and it only lives in some JS variable. Anything you receive from the client you should NOT trust. It could be changed. Generally speaking: If you want to rely on state not being readable you need to encrypt it. If you want state not to be writable then you need to chryptographically sign it. An example: You receive the user-id from the client and display sensitive data associated with it. You cannot trust that the user didn't change the user-id so you need to sign it. Alternatively you can use a random session ID that is secret and looks up all the information instead of signing your state.


@rauh: thanks for explaining it to me in the simplest way


i don’t completely understand but i think i have a better mental model of how to go on now


Hi friends. I'm just getting started with om. I see it's built around global state, but how should I deal with state that I expect to appear on a single page?


I haven't found a good pattern looking through examples


Should that just be state on a component? How do I pass it down? Do I not pass it and use channels instead?


Granted this might be easier if I knew exactly what owner was in the context of a component. I can't find a direct definition for that in docs either : (


aha, there it is


Is it possible to throttle in I just switched from using js/setInterval for updating my app-state into using transactors on window/RESIZE events. And I notice my computer goes spinning wild when Im resizing a window and I see uuid generated every 0.002 second. How could I slow this down?


wow I think I just answered my own question writing the question. I just use js/setInterval in the function call of, because it sure wont be doing anything if Im not resizing the window. pff, one of those times just writing the question the answer is right in front of you.


Well my cpu still goes from 12% to 50% when resizing a window, I just post my code here for this experiment of mine, code speak louder than words.


Are channels the sanest way to talk to parent/child components


you mean go channels?


hlolli: core/async


with the warning that Im a beginner in om, then in all the tutorials I've done and articles I read, it seems to be the strive to get away from core.async, because the async is handled in react/om (Im probably inaccurate), but you should rather try to pass in your state into the components via the factory, or if you need mutation, via a reconciler. Are you learning or


Haven't seen those terms : (


So say I have these elements: page - box - things in box -thing in box


box keeps track of a list of things


and -thing in box wants to be able to delete itself


currently om docs seem to suggest a channel approach


e.g. their todomvc example


this is local state rather than backend-related state


that's bit outdated tutorial, read rather quickstart and read it many times, word by word, took me 4 weeks actively every day to understand the basics of om. (at least thats what I recommend)

bpicolo22:03:08 isn't even mentioned on their readme


Also I recommed watching the two lectures of david nolen on om-next, gives you the motivation to go trough the "pain" of understanding om.


I will probably stick to rest for now