This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-01
Channels
- # beginners (2)
- # boot (1)
- # cljs-dev (126)
- # cljsrn (4)
- # clojars (1)
- # clojure (109)
- # clojure-austin (5)
- # clojure-austria (1)
- # clojure-boston (2)
- # clojure-brasil (33)
- # clojure-canada (1)
- # clojure-russia (1)
- # clojure-spec (62)
- # clojurescript (23)
- # core-async (1)
- # cursive (33)
- # datomic (26)
- # ethereum (2)
- # hoplon (7)
- # jobs (1)
- # lein-figwheel (1)
- # luminus (12)
- # off-topic (4)
- # om (3)
- # om-next (49)
- # perun (2)
- # protorepl (2)
- # specter (6)
- # test-check (1)
- # untangled (2)
- # vim (6)
- # yada (30)
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."
is there a computer science paradigm that makes use of that term that i might look up?
@machty “novelty” doesn’t really refer to any specific concept. It means what it is: Something new 🙂
Basically it refers to whatever new data you have.
Under the hood, it’s a merge
, but you can change that function to anything you like, if ever you need to.
@levitanong thanks
another question, i'm reading this excellent article https://circleci.com/blog/why-we-use-om-and-why-were-excited-for-om-next/
go on
>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.
Also, sho thang, brah
“sure thing, bro"
I’m not sure why they’d use a channel for that
lemme take a look at their code
@machty i think that section you’re reading is the part where they’re talking about how to do it in om.now
In om.next, you wouldn’t even pass a callback. You’d just have the component use om/transact!
ah, well
i think it’s a matter of taste.
you could use callbacks all you like, but other people prefer channels
i've heard a lot of recent backlash in the go community against channel-overuse where callbacks suffice
Hahaha
There are some patterns we use in my company (and i’m sure we’re not alone)
wherein you have some central go-loop that handles events, and matches on event types. Think pub-sub.
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
and it can just skip all the way up to that central go-loop, and perform the actions there.
not at all
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
almost like global vars but scoped within your om app.
in om.next, you can pass a map to :shared in the reconciler configuration
context is defined by a component, not by an app
and context requires you to specify proptypes.
they’re similar in that they provide deeply nested children some data, skipping the middlemen
but context is appropriate for library authors, and i don’t think shared is
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?)
Currently alpha. You can check the om release tags, and see the latest version
are there some big picture problems that remain to be solved? is there an area of om.next that's particularly volatile?
you might like to ask that question on the om channel. That’s where david nolen and antonio monteiro hang out