This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-13
Channels
- # admin-announcements (1)
- # beginners (53)
- # boot (355)
- # braid-chat (4)
- # cider (15)
- # cljsjs (3)
- # clojure (88)
- # clojure-austin (1)
- # clojure-new-zealand (4)
- # clojure-russia (46)
- # clojure-uk (7)
- # clojurescript (61)
- # component (2)
- # cursive (3)
- # data-science (5)
- # datomic (6)
- # dirac (49)
- # editors (8)
- # emacs (15)
- # funcool (15)
- # jobs (1)
- # ldnclj (10)
- # melbourne (1)
- # off-topic (14)
- # om (61)
- # om-next (2)
- # onyx (32)
- # re-frame (28)
- # reagent (19)
- # test200 (1)
- # vim (3)
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
@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 https://github.com/chrismurrph/default-db-format.
i guess what i’m really asking is about the difference between storing stuff in ring sessionstore and om app-state
(cljs.pprint/pprint @reconciler)
in the render of your root component (or from a button or something) good for debugging.
sorry, i’m learning both web security and om at the same time, so my questions might not make sense
i mean the om app-state lives on the client right? is it possible for a malicious party to manipulate it?
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
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.
@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.
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?
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 : (
Is it possible to throttle in om.next. 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 goog.events, 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. https://www.refheap.com/115923
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 om.now or om.next?
that's bit outdated tutorial, read rather om.next 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)