-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document reaction, make-reaction, and run! #166
Comments
The function make-reaction, and its macro reaction are used to create a Reaction, which is a type that belongs to a number of protocols such as IWatchable, IAtom, IReactiveAtom, IDeref, IReset, ISwap, IRunnable, etc. which make it atom-like: ie it can be watched, derefed, reset, swapped on, and additionally, tracks its derefs, behave reactively, and so on. Reactions are what give r/atom, r/cursor, and function r/cursor and r/wrap their power. make-reaction takes one argument, f, and an optional options map. f is the function that the reaction you want to make wraps. the options hash can contain an auto-run boolean (if it should automatically run its function on change, I think), on-set and on-dispose which are run when the reaction is set and unset from the DOM repectively. I'm not sure what derefed is. I'm pretty sure someone else can easily fill this in though. PS I'm not sure if you knew this. If you did, we could possibly work together to create the docstrings you that are missing - there are many more than just these ones you highlight. |
Wow... is this still outstanding? I've found the re-frame documentation is generally great for more in depth Reagent functionality, but it still surprises me that Reagent doesn't have more documentation about all of it's wonderful goodies. I'm generally pretty informed about ratoms and reactions, but I'd really like to know more about make-reaction in particular. I haven't seen anything about it on the re-frame documentation. |
Hello :-) Just a reminder about this. I come from Names can be misleading: for instance, a previous comment on this issue states
but without documentation, I could also rely on Clojure naming convention to say it's not a boolean (would be |
Could the notion of a reaction itself be described more clearly? Current explanation http://reagent-project.github.io/docs/master/ManagingState.html ( Thanks - Victor |
I came to this issue from a page of 2020 Google search results and I just have to note that this is still undocumented ;-) |
2021 and checking in to say the same :-D Perhaps this issue could be linked as a docstring to the macro or link to the improved documentation in the github? |
Reaction got a docstring previously when it was exposed in reagent.core. I've added something to the other fns and macros now. |
There are no docstrings for
reagent.ratom/reaction
, ormake-reaction
. It would be really helpful to explain:make-reaction
reaction
reaction
differs fromrun!
and when to use each.Relates to #116.
The text was updated successfully, but these errors were encountered: