This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-27
Channels
- # aleph (1)
- # beginners (48)
- # cider (34)
- # clojure (27)
- # clojure-dev (15)
- # clojure-uk (21)
- # clojurescript (27)
- # data-science (3)
- # datomic (10)
- # instaparse (30)
- # lumo (85)
- # off-topic (3)
- # perun (2)
- # portkey (24)
- # re-frame (13)
- # reagent (17)
- # ring (1)
- # shadow-cljs (77)
- # spacemacs (1)
- # test-check (3)
- # yada (4)
I'm running into a head-scratcher with re-frame. I'm getting 'Error <! used not in go block' but I've got go blocks everywhere and I've tested the functions in question outside of re-frame. Has anyone seen this before? (Seems possibly related to the go block taking 10+ seconds). I also seem to have fixed it by moving he go block into a separate function, no idea why that helped.
@jrbrodie77 is it possible to create a minimal environment that reproduces this? IIRC re-frame no longer depends on core.async for the event loop nowadays.....
i have a bunch if mp4s on a page, and when i press the spacebar i want all the "marked" mp4s to play at once. so far, my app-db
is
{:videos {1 {:id 1 :marked true :filename "blah.mp4"} 2 {:id 2 :marked true :filename "blah2.mp4"}}}
how would like do something like (dispatch [:play <id>])
and have the videos watch for this dispatch and play?@akiroz I will try to duplicate it.
@jrbrodie77 Have you seen this guide for encapsulating stateful components like players? https://github.com/Day8/re-frame/blob/master/docs/Using-Stateful-JS-Components.md
If I were to implement this, I'd store a boolean :playing
flag for each video in the app-db
and subscribe to that flag in each of the corresponding video components.
your reg-event-db :play
is just gonna look something like this:
(fn play [db [_ id]]
(assoc-in db [... id :playing] true))
oh wow, thanks i'll definitely look at that!
Oh crap, I mentioned the wrong person since the slack icons look the similar (facepalm) Sorry jrbrodie77, I meant to reply to @ackerleytng
I’m trying to use :progress-handler
on re-frame's http-xhrio
and I was wondering if there’s an example of this anywhere?
@bravilogy look in the "External Resources" document in /docs
. Example application in there.
See re-frame-http-fx