This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-03
Channels
- # admin-announcements (2)
- # alda (4)
- # beginners (15)
- # boot (89)
- # cljs-dev (88)
- # cljsrn (75)
- # clojure (149)
- # clojure-belgium (16)
- # clojure-france (2)
- # clojure-greece (6)
- # clojure-russia (108)
- # clojure-spec (39)
- # clojure-taiwan (3)
- # clojure-uk (7)
- # clojurescript (70)
- # css (3)
- # cursive (17)
- # data-science (2)
- # datascript (7)
- # datomic (41)
- # dirac (3)
- # hoplon (12)
- # instaparse (1)
- # juxt (3)
- # lambdaisland (9)
- # mount (4)
- # off-topic (6)
- # om (71)
- # om-next (4)
- # onyx (22)
- # other-languages (56)
- # perun (15)
- # proton (6)
- # re-frame (32)
- # reagent (42)
- # specter (34)
- # spirituality-ethics (7)
- # tmp-json-parsing (5)
- # untangled (13)
- # vim (4)
- # yada (6)
Would be pretty awesome to extend the re-frame tracing to work with this: https://github.com/skellock/reactotron
I opened an issue, so if you think it looks as awesome as I think, go and thumb it up š https://github.com/skellock/reactotron/issues/57
anyone doing polling in re-frame? looking for a good pattern/library to do it with events and core.async
@caio my two cents: in your init handler you setup setTimeout dispatch (and maybe setting state in the db). Or if you use mount you can wrap it in a defstate. I like to handle start and stop through events though...
thatās what iām going for, but iām seeing some bad concurrency issues, so i thought itād be better to stop and ask here if someone solved this already
@caio: what sort of concurrency issues ?
when starting/stopping it with events. two start events happening at the same time, for instance⦠but thatās probably my fault, as I wanted to keep the timeout channel inside the app-db
@caio: don't put anything which isn't simple data into the app-db - it makes for an easier life in the end. in the past, i've done something like keeping a registry of polling request control-channels somewhere, each associated with a go-block which loops polling with a timeout until it receives a stop message/close on the control channel...
how lots of go-blocks are handled by javascript? afaik, js runs on a single thread, right?
@caio: yes - go blocks are transformed into a state-machine and run fine on a single thread
good to know that, but this way Iāll have to create global vars to store the channels, and that makes me sad š
@caio: a single global atom with a map with url-keys and channel-values - not so bad for clojure-land š
itās introducing a singleton and all its issues into my pretty little functional code (channels will be the singletons). I guess Iāll go ālet over lambdaā to try and minimize this issue, but I was really hoping that there was a functional way out of this
having an issue in a handler where the ratom I am expecting is cljs.core/PersistentArrayMap so getting Uncaught Error: No protocol method ISwap.-swap! defined for type cljs.core/PersistentArrayMap any Ideas? handler below (re-frame/register-handler :add-to-want-list (fn [db [_ item-js-obj]] (swap! db assoc-in [:want-list] item-js-obj) )) if I provide the following ... it works (swap! re_frame_ui.db.default-db assoc-in [:want-list] item-js-obj) dispatching via an anchor tag
@javazquez: db in handler is not your app-db atom, it is its naked value
you are supposed to return a new value from the handler, re-frame will do the job of swapping in new value
Error: No protocol method IAssociative.-assoc defined for type reagent.ratom/RAtom: [object Object]
btw. handlers are supposed to be pure, if you happend to be calling anything with exclamation mark inside your handler fn, you are doing it wrong, very wrong š
I would bet you swap!ād some atom into you app-db, and you created this inconsistency yourself, so your situation is app-db: <ratom value:<ratom: some other value>>