This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-12
Channels
- # adventofcode (135)
- # announcements (1)
- # beginners (192)
- # boot (5)
- # calva (130)
- # cider (42)
- # cljdoc (4)
- # cljs-dev (6)
- # cljsrn (3)
- # clojure (222)
- # clojure-europe (2)
- # clojure-greece (5)
- # clojure-italy (24)
- # clojure-nl (23)
- # clojure-russia (1)
- # clojure-spec (6)
- # clojure-uk (67)
- # clojurescript (35)
- # cursive (39)
- # datomic (61)
- # emacs (17)
- # figwheel (3)
- # figwheel-main (2)
- # fulcro (12)
- # hyperfiddle (10)
- # juxt (3)
- # leiningen (10)
- # nrepl (35)
- # off-topic (34)
- # onyx (3)
- # pathom (6)
- # quil (5)
- # re-frame (29)
- # reitit (6)
- # ring (1)
- # ring-swagger (8)
- # shadow-cljs (37)
- # spacemacs (9)
- # sql (9)
- # tools-deps (24)
- # unrepl (1)
- # vim (1)
just checking, is this still the only way to have a global interceptor? https://github.com/Day8/re-frame/blob/master/docs/FAQs/GlobalInterceptors.md
we would just like to add some spec validation of the app-db
but there are hundreds of reg-event-db
spread over the place, having our own wrapper could work but if there is another way would be even better
tbh actually I think that spec validation is such a common pattern that it could be even be a re-frame feature ideally?
only problem is how to construct the massive spec, considering it's really in theory composed instead of many layers of sub-specs
And for many situations you only want to spec the area just updated.
By "the area", I mean the area within app-db
Although obviously checking the whole of app-db
could be done each time. Just might be inefficient.
I guess we haven't insisted on any approach. We've just left the pieces there for everyone to make their own decisions.
yes ok I'll give it a go
and well if we turn it on only for dev/test we don't really care about efficiency
but maybe another way to register a global interceptor would be nice, even if surely someone could complain it's magic
Hi @andrea.crotti
I think add-post-event-callback
is what you are looking
It’s not documented feature I think ))
uh nice @ts1503 but given it's undocumented maybe I should not use it, in case it changes/gets deleted in the future?
It is certainly a part of the official interface
But this is the recommended way https://github.com/Day8/re-frame/blob/master/docs/FAQs/GlobalInterceptors.md
can anyone point me to an example or guidance for integrating a substantial third-party component into re-frame in a sane way? I'm looking at CodeMirror in particular, but any advice is welcome.
it requires calling JS functions with an element reference once the component is mounted and so on; I've never used React directly, so I'm a bit out of my depth.
being able to update the DB with, say, errors to highlight in the editor, and have a subscription cause a call to CM would be ideal.
(I don't care to put the text contents into the DB in real time, I'm okay with pulling the contents on a Save button's action.)
@braden.shepherdson There’s this: https://github.com/Day8/re-frame/blob/master/docs/Using-Stateful-JS-Components.md
that's quite a first paragraph 😄
that looks like exactly what I need, thanks!
For codemirror, in my project we did it like this: https://gist.github.com/isaksky/a96476fa51a10ba903b7c6bdcb13c85b
@braden.shepherdson also https://purelyfunctional.tv/guide/re-frame-lifecycle/ is a pretty good overview of form 3 style components