This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-01
Channels
- # aleph (1)
- # bangalore-clj (5)
- # beginners (24)
- # boot (113)
- # cider (42)
- # cljs-dev (2)
- # cljsjs (2)
- # cljsrn (3)
- # clojure (37)
- # clojure-austin (4)
- # clojure-brasil (3)
- # clojure-france (55)
- # clojure-greece (15)
- # clojure-ireland (4)
- # clojure-italy (13)
- # clojure-russia (37)
- # clojure-spec (50)
- # clojure-uk (31)
- # clojurescript (49)
- # component (12)
- # consulting (1)
- # cursive (6)
- # datascript (9)
- # datomic (27)
- # editors (2)
- # garden (1)
- # hoplon (18)
- # jobs (1)
- # klipse (25)
- # lein-figwheel (1)
- # leiningen (1)
- # luminus (2)
- # om (53)
- # om-next (8)
- # onyx (5)
- # parinfer (4)
- # perun (4)
- # re-frame (13)
- # remote-jobs (1)
- # ring (1)
- # ring-swagger (3)
- # rum (52)
- # spacemacs (36)
- # specter (13)
- # sql (3)
- # untangled (49)
- # vim (11)
- # yada (9)
@arohner maybe, but it more ok just to swap!, should give you the same end result, Im pretty sure you will hit a problem in the long run doing recursive transactions.
@fenton you need to clarify what your problem is
what did you expect to see (and where) vs. what you're seeing
this works:
cljs.user=> (om/db->tree [:me-mail] @my-state @my-state)
{:me-mail ""}
Is {:value [:foo]}
in a (defmethod mutate)
supposed to work? Everything behaves fine when I (om/transact c [(foo) :foo])
, but doesn’t work when I (om/transact c [(foo)])
, with {:value [:foo]}
in the defmethod
@arohner https://github.com/omcljs/om/wiki/Om-Next-FAQ#what-does-value-keys--do-from-a-mutation-result-map
(spoilers: it doesn't mean absolutely nothing 🙂 )
also, it seems like a nice feature to have, so the “api” around what should happen when you (transact [(foo)]) is more encapsulated
needing to specify (transact [(foo) :foo])
everywhere in your app seems like an opportunity for bugs
@arohner you can always wrap your transact!
calls with your own function
nothing
I don't see why
I think the docstring is consistent with the behavior
:value is an optional hint at keys affected by the mutation; it has no effect on rerendering
behavior, or lack of thereof
FWIW, I’ve found the docs for om.next to be incredibly frustrating, more so than om now. I’d be happy to help improve them, but I don’t know enough about how it works yet.
yeah, they're lacking a bunch of things
Hopefully we'll be able to put together a website soon enough, with good documentation
@anmonteiro I've always been confused by that too: hint to whom? Is there a way that my own code should/could be reading the :keys
value coming out of the parser and reacting to it?
@peeja yeah I think you can use the return value of transact!
for remote stuff you'll have :keys
in the merge
's res
you can queue them for re-rendering
you can call another transact!
too with those keys
e.g. (transact! this [:foo :bar])
transacts don't necessarily need to have a mutation 🙂
@peeja btw have you checked out the new Compassus release?
seems to have all the stuff you were asking for 🙂
@anmonteiro: Ooh lovely! Will do!
check out the changelog for breaking changes
everything's written down there, should be easy enough to upgrade
serious newbie question, but assuming I have a bunch of factory functions for my defui created components, is there an easier way to render a hierarchy them dynamically than passing invocations of the factory functions as children?
i.e. right now I have something like
(component-a {:children (component-b {:children (component-c {:some-prop 123})
@mss hrm normally the way I render children is:
(component-a nil
(component-b nil
(component-c {:some-prop 123})))
you can get a component's children through (om.next/children this)
Ok, stupid question, that didn’t seem to be documented anywhere. if I create a component with its factory, passing nil to props, it can query from the root of the app-state?!
hrm, this seems connected to transacting. a default read behaves as I previously expected