om

Please ask the channel first, not @dnolen directly!
urbank 2017-07-21T13:13:44.441325Z

Is there a way to trigger a callback after a rerender? or just requestAnimationFrame?

ajs 2017-07-21T13:22:19.684718Z

@urbank : on every re-render or just some? your view function runs on every render, so you could just put logic right in there, or call another function, which will run on every re-render

urbank 2017-07-21T13:22:52.700432Z

@ajs Oh, yeah, I wasn't specific enough. I meant after an om/transact!

urbank 2017-07-21T13:23:16.711909Z

after a specific om/transact!

ajs 2017-07-21T13:23:58.732457Z

what i do myself is send all transact or update messages on a go channel. then when i listen to that channel, if a particular key that was sent along with the transact or update messages is of interest, i do something specific when i receive that transact for that key

ajs 2017-07-21T13:25:54.789038Z

incidentally the reason i do this in Om Now is so that any component function can transact on any part of Om state, even if it is not related to the cursor that component received

urbank 2017-07-21T13:27:03.823206Z

@ajs Ah, I see. Interesting. Haven't seen go block used much in the om next examples within the ui

ajs 2017-07-21T13:27:12.827309Z

yeah om next is different

ajs 2017-07-21T13:27:22.832283Z

but you can still write Om Now code using Om Next

ajs 2017-07-21T13:27:32.837791Z

the dom and core namespaces are the same

ajs 2017-07-21T13:27:56.849775Z

i'm actually a big fan of Om Now

urbank 2017-07-21T13:29:12.887169Z

@ajs You prefer it to om next?

ajs 2017-07-21T13:29:19.891266Z

definitely for me, for now

ajs 2017-07-21T13:29:29.895892Z

Om Next is really a very different animal

ajs 2017-07-21T13:29:47.905169Z

Om Now is stable and pretty simple. Om Next is neither of those things (yet)

dehli 2017-07-21T13:30:24.924790Z

Hey guys, I'm sure this is a Clojure mistake but I'm having a tough time figuring out what my issue is with updating my state. Does anything jump out? When I call this, state doesn't change.

(om/update-state! this
                  update-in
                  [:props :project/nodes]
                  (fn [nodes]
                    (vec (map #(merge % {:node/selected true})
                              nodes))))

gardnervickers 2017-07-21T13:30:44.935213Z

@urbank you can use :tx-listen to get a feed of transactions. We've been considering using it for things like reporting google analytics.

ajs 2017-07-21T13:31:45.966824Z

@dehli which state are you trying to update, the app state or the component local state?

dehli 2017-07-21T13:31:53.970963Z

component local state

urbank 2017-07-21T13:32:31.990103Z

I find that it's quite simple using #fulcro

urbank 2017-07-21T13:33:00.004500Z

That sounds fairly straightforward. I'll check it out.

dehli 2017-07-21T13:39:58.218127Z

okay, so this is the problem from coding late at night 🙂 I'm overriding state in componentWillReceiveProps

ajs 2017-07-21T13:40:14.226660Z

ah

dehli 2017-07-21T13:40:39.240004Z

Thanks for the help!

levitanong 2017-07-21T14:47:14.578659Z

Hi all, I’m trying to use om/force, and the documentation says to look for a :target key in the ast, but it doesn’t seem to exist in ast. I have, however, found :target in env. Has the target been moved to env, or is this a different thing altogether?