This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-12
Channels
- # admin-announcements (1)
- # bangalore-clj (13)
- # beginners (149)
- # boot (123)
- # cider (7)
- # clojure (167)
- # clojure-brasil (3)
- # clojure-greece (1)
- # clojure-korea (2)
- # clojure-new-zealand (2)
- # clojure-russia (70)
- # clojure-sanfrancisco (3)
- # clojure-spec (84)
- # clojure-uk (36)
- # clojurescript (300)
- # code-reviews (242)
- # community-development (34)
- # core-async (4)
- # css (1)
- # cursive (37)
- # datascript (1)
- # datomic (20)
- # defnpodcast (1)
- # dirac (15)
- # events (7)
- # garden (12)
- # hoplon (100)
- # lein-figwheel (11)
- # off-topic (2)
- # om (69)
- # om-next (3)
- # onyx (86)
- # planck (14)
- # proton (4)
- # protorepl (1)
- # quil (2)
- # re-frame (53)
- # rum (3)
- # untangled (1)
- # vim (50)
Thanks mike. I'll give it a shot.
@mikethompson: Just to clarify, re-frame-async-flow
uses events, not effects, in the dispatches? I think this is what tripped me up before. Starting up a stateful service is a side effect right? I’m okay with making everything event handlers if it’s just a semantic difference.
event handlers compute the effects
of an event
. They return a decription of the required effects. A map of them.
After that, it is up to the effect handlers to action these effects.
The new docs in develop
(including the README) are much better at explaining all this
https://github.com/Day8/re-frame/blob/develop/README.md
if you have app-db getter functions that are used by both event handlers and subscriptions, which namespace do you put them in?
@paulb: I tend to put them in my db
namespace
Inspired by @andre, I have tried to find a way to diagram aspects of re-frame (so far just event handling). These will end up in the docs. Open for comment. Be kind
Hmm. I thought I get a white background by default. Not grey. That screws things up.
Will provide again. I'll delete that attempt for now.
I've been teaching myself Figma
And I copied your ideas :-)
But I live too much in the bubble to know if this really works
Does you eye "flow" over the material?
Or is it a dense slog
Where I could, I tried to make it a top left to bottom right kinda flow
@mikethompson I am liking the graphs. Please keep it up.
I'm curious to hear from those new-ish to re-frame. Do the new diagrams help?
(when read in conjunction with new docs in develop
)
Anything that worked, or didn't work?
i think they should be near the text, for me it's hard to understand thread only looking on the pictures
agreed
Hey all, I’m hoping someone can help me find a URL. I remember reading a blog post or something recently that described using spec to ensure that the app was always in a consistent valid state. It set up specs for all the data in the db, and then wrote a custom dispatch function to use spec to validate the db after every dispatch. Or something along those lines. Does that ring a bell with anybody?
I happen to be going through to todomvc exaxmple, and they do it in there: https://github.com/Day8/re-frame/tree/master/examples/todomvc
spec is in db and validation is in events
aha, the examples! I’ve read thru the docs and the faqs about three times thinking I was somehow skimming over it. Thanks much
Is it possible to make a function reactive? I want to have it rerunning, whenever a given atom changes
(defn reactive-fn [atom]
(let [value (reaction atom)
(println @value))
Like this?
I just went over the todomvc example, and it does define a spec for the app db, however that’s not the blog post I was thinking of. The one I’m looking for had a more detailed discussion/tutorial about setting up the spec for the app db and then writing a custom dispatch function so it would check the db on every reframe event dispatch
@seantempesta: I've been hacking on re-frame / datascript / posh some: https://github.com/timgilbert/haunting-refrain-posh
I've been meaning to blog about it but don't have time
The version on develop is just storing a datascript conn object in the app-db which seems less than ideal
...and I wind up needing to deref the posh connection one more time than I expected. It does work though, in the sense that you transact data to the conn and the correct components rerender
I have a branch feature/datascript-coeffect
in which I'm attempting to use a datascript conn as a coeffect instead. The code seems cleaner in some ways but I haven't managed to get the actual transact data -> re-render bit to work yet
@mikethompson the diagram looks fantastic! I find it very helpful in understanding what’s going on. Some background: I’ve been dancing with re-frame for about 6 months, read the original readme two times (loved it), have been stalking this slack channel and soak up everything related to re-frame. I am chomping at the bit to start building an ambitious app using re-frame as soon as I finish the current project. I’m super impressed with the interceptors chain. A very powerful concept. Seeing it in the diagram increased my clarity and intuitive understanding of the concepts involved. I had some gaps in understanding the function arguments (what gets passed into what handler). The diagrams helped a lot.
I also read through the new Readme in the dev branch. It is a lot shorter and doesn’t seem to have as much character as the original readme. Maybe a good thing to keep it shorter to lower barrier of entry (if that is what you want at this stage of the project ;-)
thank you so much for this fantastic framework! It gets me excited about front end dev again. I’ve stayed away from it and focused on server side for the last 5 years.
@danielgrosse Sounds a lot like the new reagent.core/track
function: https://reagent-project.github.io/news/news060-alpha.html
I haven't seen a need for something like that since I have re-frame, what is your use case?
Yeah, I agree with @curlyfry, if you're in the re-frame context, then using a subscription is probably your best bet, also, re-frame can do subscription deduplication and other cool stuff for you