Fork me on GitHub
#re-frame
<
2022-08-09
>
erwinrooijakkers07:08:10

In the style guide (https://guide.clojure.style/#common-metadata) it’s explained to mark deprecated functions with ^:deprecated meta data and an explanation in the docstring. How do we add metadata and docstrings to reg-fx, reg-event-fx and reg-event-db?

erwinrooijakkers07:08:59

Or when not possible, what is a way to mark them as deprecated?

p-himik08:08:36

If you need it just for developer's documentation, leaving a comment would be enough. If you need to also issue a warning in run time, just add a warning-issuing expression to the effect/event handler as the very first line. If you need tooling support (e.g. showing all deprecated functions without running full text search manually), you can extract handler functions into proper vars and attach that metadata to them.