This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-02
Channels
- # aws-lambda (5)
- # bangalore-clj (1)
- # beginners (96)
- # boot (66)
- # cider (39)
- # cljsjs (2)
- # cljsrn (5)
- # clojure (265)
- # clojure-android (1)
- # clojure-france (1)
- # clojure-greece (32)
- # clojure-italy (4)
- # clojure-russia (2)
- # clojure-sg (1)
- # clojure-spec (27)
- # clojure-uk (25)
- # clojurescript (88)
- # cursive (4)
- # datomic (31)
- # emacs (96)
- # hoplon (10)
- # immutant (14)
- # jobs (2)
- # luminus (1)
- # lumo (66)
- # off-topic (128)
- # om (8)
- # om-next (2)
- # onyx (9)
- # parinfer (5)
- # re-frame (37)
- # reagent (16)
- # rum (9)
- # schema (3)
- # specter (34)
- # unrepl (8)
- # yada (21)
@eveko Did you figure out your problem? The first argument of a reg-event-fx
is not the db, but a map of coeffects, which contains the db. Changing [db [_ logindata]]
to [{:keys [db]} [_ logindata]]
should work.
@hkjels possibly because (take) produces a lazy sequence. See https://stuartsierra.com/2015/08/25/clojure-donts-lazy-effects for more.
Morning guys. I'm a bit curios if there is an http-xhrio implementation equivalent for cljs-http. It seems fairly straight forward to do, but has somebody done the work already?
I am trying to translate this bit of JS logic to re-frame and cljs:
var osd = OpenSeadragon({
id: "openseadragon1",
prefixUrl: "vendor/js/openseadragon-bin-2.2.1/images/"});
Aside from invoking cljs equivalent code, I am wondering where to put that code. It needs to run once, at the beginning of the lifecycle of the re-frame app, but references an element by id that must already be rendered.hmm, I seem to be able to reference the id "openseadragon1" even though it is generated in my reframe views
so the issue seems to be that I need to do some initialization stuff for that var, but can't do that in the viewer.core init
Not sure if I understand, but:
On reagent/react you can pass [:div {:id "abc" :ref callback}]
where callback
is a function that receives one argument, that argument was the element.
so now I have these callback handlers:
(defn add-osd-handlers []
(.addHandler js/osd "open" osd-open-success)
(.addHandler js/osd "open-failed" osd-open-failure))
(defn render-file
[]
(let [id "textarea"
txt @(subscribe [:app/text-area])
settings @(subscribe [:app/editor-settings])
args (clj->js settings)]
(reagent/create-class {:component-did-mount (fn [e]
(let [el (aget e id)]
(doto (.fromTextArea js/CodeMirror el args)
(.on "change" #(dispatch [:app/save-file (.getValue %)])))))
:render (fn [this]
[:div [:textarea {:value txt
;; when it render first time, will call :ref fn
:ref #(aset this id %)}]])})))
My use case. I also not really sure if it's the "right way", but works fine. If you find something "better", please share 🙂
I need to attach a handler to that component that indicates that shouldComponentUpdate: false
or something akin to that.
possibly, having the node subscribe to a value that never changes could do it, according to my understanding of https://github.com/Day8/re-frame/wiki/When-do-components-update%3F
Hi. There is this project called RealWorld, which is sort of like a more complete (and fullstack) TodoMVC example app https://github.com/gothinkster/realworld
As an exercise, I have started a re-frame implementation at https://github.com/polymeris/re-frame-realword-example-app
I am no expert in cljs or re-frame, though, so if anyone has some spare time and wants to review it, I'd appreciate it
great idea
what other famous example apps are there?
TodoMVC, Java's Pet Store
hi all , does anyone here know how to implement the android part of this react-native-plugin (https://github.com/zo0r/react-native-push-notification ) in re-frame
i know it mentions only if i did not use the link command manually , just not sure if that applies to re-frame or not, referring to this statement [Manually register module in MainApplication.java (if you did not use react-native link)]
might be better to ask in #cljsrn
what does d-vec
represent here:
(reg-sub
:a-b-sub
(fn [q-vec d-vec]
[(subs/subscribe [:a-sub])
(subs/subscribe [:b-sub])])
(fn [[a b] [_]] {:a a :b b}))
Now that you can subscribe within a form-1 component, there aren't too many use cases left for dynamic parameters
as your standard parameters become dynamic