Fork me on GitHub
#om-next
<
2016-10-01
>
machty14:10:01

from the getting start guide: "The reconciler accepts novelty, merges it into the application state, finds all affected components based on their declared queries, and schedules a re-render."

machty14:10:19

i believe i understand this sentence, but haven't seen "novelty" used in this context

machty14:10:39

is there a computer science paradigm that makes use of that term that i might look up?

levitanong15:10:22

@machty “novelty” doesn’t really refer to any specific concept. It means what it is: Something new 🙂

levitanong15:10:37

Basically it refers to whatever new data you have.

levitanong15:10:20

Under the hood, it’s a merge, but you can change that function to anything you like, if ever you need to.

machty15:10:41

>But in the UI, the “Delete” button should really be part of the grocery item component. Just as our data doesn’t map perfectly to our UI, neither do our mutation operations. >The usual solution to this problem in Om is core.async channels. The grocery list component would set up a channel and pass it to each list item. To delete itself, an item component would put a message on that channel. Meanwhile, the list component would run a go block to listen for the message, and when it got it, it would om/update! its cursor.

levitanong15:10:41

Also, sho thang, brah

levitanong15:10:59

“sure thing, bro"

machty15:10:28

yeah i just didn't know if inadvertently did a bro-y thing

levitanong15:10:33

I’m not sure why they’d use a channel for that

machty15:10:00

that was my question... why not just have the list component pass in a callback?

levitanong15:10:14

lemme take a look at their code

levitanong15:10:23

@machty i think that section you’re reading is the part where they’re talking about how to do it in om.now

machty15:10:43

confirm, i'm just trying to understand why core.async would even be used for om.now

levitanong15:10:51

In om.next, you wouldn’t even pass a callback. You’d just have the component use om/transact!

levitanong15:10:08

i think it’s a matter of taste.

levitanong15:10:15

you could use callbacks all you like, but other people prefer channels

machty15:10:31

i've heard a lot of recent backlash in the go community against channel-overuse where callbacks suffice

machty15:10:47

presumably the same disagreements apply to core.async discussions

levitanong15:10:24

There are some patterns we use in my company (and i’m sure we’re not alone)

levitanong15:10:47

wherein you have some central go-loop that handles events, and matches on event types. Think pub-sub.

levitanong15:10:41

so instead of some deeply nested component having to pass an action through several levels of callbacks, it can just get the channel from (:pub-chan (om/get-shared owner)) and put! the action in there

levitanong15:10:00

and it can just skip all the way up to that central go-loop, and perform the actions there.

machty15:10:25

hmm is get-shared like context in react?

machty15:10:31

i guess it's like context but scoped to a specific owner

machty15:10:35

so you'd still have to pass the through the owner to all the leaf components

levitanong15:10:09

in om.now, you can pass :shared to the root function, and any component down the line will be able to access those values via om/get-shared

levitanong15:10:20

almost like global vars but scoped within your om app.

machty15:10:32

how is that different from context in React?

levitanong15:10:35

in om.next, you can pass a map to :shared in the reconciler configuration

levitanong15:10:00

context is defined by a component, not by an app

levitanong15:10:14

and context requires you to specify proptypes.

levitanong15:10:52

they’re similar in that they provide deeply nested children some data, skipping the middlemen

levitanong15:10:08

but context is appropriate for library authors, and i don’t think shared is

machty16:10:22

so what is the status of Om.Next? Is it still alpha/beta? (also where do I go to answer this question myself next time?)

levitanong16:10:07

Currently alpha. You can check the om release tags, and see the latest version

machty16:10:14

are there some big picture problems that remain to be solved? is there an area of om.next that's particularly volatile?

levitanong16:10:08

you might like to ask that question on the om channel. That’s where david nolen and antonio monteiro hang out