Fork me on GitHub

just checking, is this still the only way to have a global interceptor?


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?


In docs this feature marked like - for advanced cases. Maybe your case is advanced?)


It is certainly a part of the official interface

Braden Shepherdson16:12:59

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.

Braden Shepherdson16:12:29

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.

Braden Shepherdson16:12:26

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.

Braden Shepherdson16:12:51

(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 Shepherdson16:12:06

that's quite a first paragraph 😄

Braden Shepherdson16:12:54

that looks like exactly what I need, thanks!


For codemirror, in my project we did it like this:


another option


@braden.shepherdson also is a pretty good overview of form 3 style components