Fork me on GitHub
#re-frame
<
2016-07-14
>
vikeri11:07:48

Any tips on how to work with time as a reactive value to be subscribed to?

dobladez12:07:31

@vikeri Not sure I get what you need. The easy answer: use js/setInterval (or a core.async loop) to dispatch, on the handler you modify what you want from your app-db... and define a subscription to read from it

vikeri12:07:04

@dobladez: I am using the current date (without time of day) in a lot of places and if the app is not closed and then opened the day after it shows weird stuff. I don’t want to continuosly poll the date and update it in my atom when it changes, but maybe that is what I will have to do.

dobladez12:07:15

may be you can calculate how much time is left till the next date change, and schedule a call to update at that point

dobladez12:07:04

anyway, I don't see anything wrong with having a dispatch that updates every minute or so

vikeri13:07:30

True, just thought that there would be some slightly fancier FRP way of doing it automatically

Macroz13:07:32

FRP yes, but this is not FRP

Macroz13:07:53

just don't send too many updates πŸ™‚

richiardiandrea23:07:53

Hello channel πŸ˜„ Was there a lib to print a page with a nicely formatted re-frame.db/app-db somewhere?

darwin23:07:15

what about (clojure.pprint/pprint re-frame.db/app-db) πŸ™‚

naomarik23:07:59

@mikethompson: i saw a youtube video awhile back where some dude had a very nicely CSS'd tree-style interface for the atom

naomarik23:07:09

i can't recall what the video is though

richiardiandrea23:07:24

yeah that would be neat

mikethompson23:07:40

Perhaps Yogthos' library? See my link above.

naomarik23:07:13

wasn't this one πŸ˜‰

naomarik23:07:21

ill try finding it through my youtube history

darwin23:07:27

do you want it just for one-off presentation, or as something to be used during development?