This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-19
Channels
- # beginners (34)
- # boot (111)
- # cider (37)
- # clara (57)
- # cljsjs (1)
- # cljsrn (22)
- # clojure (156)
- # clojure-austin (2)
- # clojure-mke (7)
- # clojure-russia (9)
- # clojure-spec (221)
- # clojure-uk (47)
- # clojurescript (42)
- # code-reviews (4)
- # community-development (9)
- # core-async (3)
- # cursive (50)
- # datomic (81)
- # emacs (12)
- # events (5)
- # hoplon (1)
- # jobs (2)
- # lein-figwheel (4)
- # leiningen (1)
- # luminus (3)
- # mount (2)
- # off-topic (1)
- # om (94)
- # om-next (3)
- # onyx (33)
- # re-frame (23)
- # reagent (41)
- # remote-jobs (9)
- # rum (30)
- # slack-help (2)
- # specter (1)
- # untangled (20)
- # yada (17)
react.inc.js:19817 Uncaught Invariant Violation: Expected onClick listener to be a function, instead got type object
The results in the console log are showing that the :on-click handler is indeed a function, so perhaps it has to do with the timing of React rendering? Appreciate any insights...
Hi. I have html audio tag that has src which is updated with subscription. But how I can launch play event after and only after subscription has been updated? I can't just dispatch update-src and play events at the same time as I have understood correctly ordering of events are not anyway guaranteed.
You may need an on-change listener attached the src which dispatches a second event to fire the audio player
@neurogoo still thinking about this. A subscription is effectively an on-change listener, Can you just add a new subscription?
I have never tried myself, but in hiccup I would guess (fn [src] [:audio [:source {:src src}]])
ah yes, that how I do it now with src, but where you would attach subsription listener that would launch play event?
you could drop it in the html somewhere, and deref when it is called - i.e [:div (said-audio-fn @src)]
Have you checked out https://github.com/Day8/re-frame/blob/master/docs/EffectfulHandlers.md#effectful-handlers? Might have some tips for performing side-effects
I did look it, but if I remember correctly the order of the returning map is not anyway forced
correct, order is not enforced for effects @neurogoo