This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-13
Channels
- # aws-lambda (7)
- # beginners (80)
- # boot (134)
- # cider (11)
- # cljs-dev (5)
- # cljsjs (3)
- # cljsrn (19)
- # clojure (144)
- # clojure-austin (2)
- # clojure-berlin (3)
- # clojure-greece (6)
- # clojure-italy (3)
- # clojure-russia (95)
- # clojure-spec (57)
- # clojure-uk (120)
- # clojure-za (2)
- # clojurescript (71)
- # component (1)
- # css (1)
- # cursive (22)
- # datascript (2)
- # datomic (101)
- # dirac (9)
- # docker (3)
- # emacs (10)
- # events (2)
- # immutant (3)
- # leiningen (2)
- # om (63)
- # om-next (1)
- # onyx (6)
- # pedestal (55)
- # portland-or (3)
- # protorepl (2)
- # re-frame (30)
- # reagent (10)
- # ring-swagger (1)
- # rum (31)
- # spacemacs (5)
- # specter (9)
- # untangled (90)
- # vim (46)
- # yada (2)
Btw, not sure I shared this here before: made a few components to inject ssierra component systems into React context and start/stop them: https://gist.github.com/martinklepsch/8e8a924a9e2b3293688530e905fd3e4e
Not 100% decided you need component on the client but I like being able to swap implmentations. E.g. when developing while not having a network connection I swap my “internet database” with my “offline database” and the whole thing continues to work 🙂
@tonsky stupid question - why does rum reactive mixin requires custom deref function instead of some setup function on the atom it needs to watch?
because it needs to subscribe to the atom besides deref-ing it for gettings its contents
(I'm new to reagent, rum and react, though. I just currently set up my first app with one global atom, and subscribed to its changes where I wrote
(add-watch world :updated-world (fn [_key _ref _old _new]
(rum/mount (root-component) (js/document.getElementById "app"))))
(add-watch local :local-world (fn [_key _ref _old _new]
(rum/mount (root-component) (js/document.getElementById "app")))))
)the reactive mixin is there so you don't need to manually subscribe to atoms and re-render, does just that
so I basically will not track in the header of component which atoms it was subscribed to, this is the purpose, right?
last noob question - am I right that in React I must somehow update this internal state of any input-field component with on-change callback?
and the logic of display will be something like (or (internal-state component) (:server-field @server))
> I must somehow update this internal state of any input-field component with on-change callback?
this is optional, you are referring to what React calls "controlled components" https://facebook.github.io/react/docs/forms.html
but you can store input value state in the DOM just fine with uncontrolled components https://facebook.github.io/react/docs/uncontrolled-components.html