This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aleph (3)
- # beginners (25)
- # cider (12)
- # clojure (42)
- # clojure-canada (3)
- # clojure-nl (1)
- # clojure-russia (2)
- # clojure-spec (13)
- # clojure-uk (24)
- # clojurescript (23)
- # cloverage (1)
- # datomic (7)
- # figwheel-main (3)
- # jobs-discuss (14)
- # onyx (48)
- # parinfer (3)
- # re-frame (20)
- # reitit (28)
- # shadow-cljs (3)
- # testing (1)
- # vim (37)
@dfcarpenter some example apps listed in here https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
@drewverlee re-frame originally used middleware but switched to use interceptors instead because they achieve the same thing, but in a "data oriented" way rather than a "higher order functions" way. As a result, interceptors are more flexible than middleware.
Both middleware/interceptors provide mechanism by which you can wrap core functionality (event handling in the case of re-frame) with code that handles cross cutting concerns like logging, integrity checking, coordination, etc. In re-frame we've taken that further and made interceptors responsible for effects and coeffects (thus providing a way for event handlers to be pure).
Have a read through: https://github.com/Day8/re-frame/blob/master/docs/Interceptors.md and look at the standard interceptors: https://github.com/Day8/re-frame/blob/master/src/re_frame/std_interceptors.cljc
@drewverlee > This might be obvious, but why call the larger app state “coeffects” Hmm. App state is one example of a coeffect. An important one, yes, but just one example. Be sure to read through all the docs. I feel that many of your questions will be fully answered by what is available in: https://github.com/Day8/re-frame/blob/master/docs/README.md
I have always wondered the same thing, not knowing the word “coeffect”. The Google did not help. Is that a Britishism?
Good info on coeffects can be found at http://tomasp.net/coeffects/ - the first couple of paragraphs covers it pretty well for a quick definition. I think the terminology comes more from math than anything else but I could be so wrong about that (I tend to ascribe anything I don’t understand to math in one way or another)
Ok, so it is a well-established term, along with
context. The term itself sounds wrong for what it denotes, but as you suggest the math term
coefficient makes me feel better about the whole thing. 🙂
@ferossgp > Hi! How is better to wrap a component with data fetcher in re-frame? Views in re-frame are not imperative. They simply render the state in app-db. This is at odds with the way things are often done in the js React world. Some further explanation here: https://github.com/Day8/re-frame/blob/master/docs/FAQs/LoadOnMount.md
Storing data in ratoms which are closed over by renderers is ... to be avoided as much as possible, and is absolutely not the design place to be starting from.
Hi, I’m reading https://github.com/Day8/re-frame/blob/master/docs/SubscriptionFlow.md#reg-sub-raw but I understand what would be the reason not to use
@(subscribe [:x]) inside a normal
@jvuillermet One point is that if you conditionally deref something in the subscription handler, you won't get notified on the changes. With signals, you'll always be notified.
A fragment from the above link that points to this: "Remember to deref any use of app-db and subscribe. It is a rookie mistake to forget. I do it regularly."
Thanks @p-himik ! I’m not sure to understand the first point nor how to reproduce it. Would you have an example ? Also I realise signals allow to have a pure function
Hmm, while providing an example I realized that there's no reason for a user to want the sub to be updated when some sub is not derefed, so disregard my statement above.