Fork me on GitHub
#re-frame
<
2017-05-12
>
mikethompson00:05:29

@macalimlim I would have thought the re-frame docs themselves would have been a good place to start

mikethompson00:05:17

All organised ina tutorial style

cmal00:05:33

Are there any demos about how to do polling ajax(control repeatedly make a same ajax request) with re-frame? Thanks.

mikethompson00:05:11

use dispatch-later ?

cmal00:05:16

Thanks. I'll try it.

cmal00:05:24

I want to get a stock price every 3seconds when they are on trading.

mikethompson00:05:18

The simple example updates the clock every 1 second

cmal00:05:00

ok. Thank you very much.

mikethompson02:05:19

--------------------------- WARNING --------------------------- The re-frame-template has encouraged use of this construct:

(def debug?
  ^boolean js/goog.DEBUG)
The idea being that one could use debug? to trigger Dead Code Elimination (DCE) in :advanced builds But a bug in recent version of CLJS means this code doesn't work. So you need to make a subtle adjustment:
(def debug? 
   ^boolean goog.DEBUG)     ;; remove the leading js/

mikethompson02:05:18

David Nolen just reduced the bug to "minor" importance, so it probably won't get fixed any time soon, if ever: https://dev.clojure.org/jira/browse/CLJS-2023

cmal02:05:33

Thanks:+1:

mikethompson02:05:04

The template itself has been updated BUT if you have already generated a project from it, you'll have to manually update the generated code.

cmal02:05:44

(def debug?
  ^boolean goog.DEBUG)

Oliver George03:05:57

Just used :async-flow for the first time. Loved it.

Oliver George03:05:56

My use case wasn't for boostrapping.

Oliver George03:05:51

I had a event handler which needed to fetch various bits of data before it could do some processing. :async-flow gave me a simple state machine style way of coordiating those activities.

mikethompson03:05:02

@olivergeorge ah, thanks. Always good to get successful feedback. I've always felt async-flow should have been useful to lots of people.

Oliver George03:05:40

🙂 Preparing data for handlers seems like a good use case to me.

Oliver George03:05:27

It's too early for any serious feedback but two things felt kind of odd - not that I see better solutions. 1) needing unique event-ids for the state machine steps, 2) passing data between the handlers involved.

Oliver George03:05:49

1) wasn't a problem this time but feels like it could be

Oliver George03:05:14

2) made me wonder if some complementary cofx might be helpful.

Oliver George03:05:36

e.g. do two AJAX GETs and use them in handler.

Oliver George03:05:11

the only way to pass the data is putting it in app-db but it's kind of private data so that feels odd.

antonmos18:05:06

Hello! I am looking for a way to register an unhandled error handler in re-frame or reagent. The idea is that when any unhandled error occurs, a user friendly message is displayed. is there a standard way of doing this? Thanks!

antonmos18:05:32

thank you @souenzzo, reading now

antonmos18:05:34

unfortunately, i am not seeing anything related to how errors play into interceptor execution

antonmos19:05:01

ah, apparently this is work in progress https://github.com/Day8/re-frame/pull/330