You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reagent comes with several atom-like types that implement IDeref and IWatchable, but to my knowledge does not support implementing your own data sources. In Rum there is a react function that basically sets up the watcher and calls deref. Could Reagent support the same? From my limited understanding it'd basically be
(defnreact [a]
(notify-deref-watcher! a)
@a)
This would enable implementing elegant reactive behavior over JS libraries, websockets, localstorage, you name it. Anything that supports taking the value and notifying changes.
Note that notify-deref-watcher! itself is a private function, so it's currently not kosher to implement this externally.
The text was updated successfully, but these errors were encountered:
The implementation is indeed quite simple, as Ratom doesn't itself need to do much, just to register itself to reactive context, and the reactive context (reaction) just uses regular IWatchable protocol to listen for changes, and normal atoms implement that.
Reagent comes with several atom-like types that implement
IDeref
andIWatchable
, but to my knowledge does not support implementing your own data sources. In Rum there is areact
function that basically sets up the watcher and calls deref. Could Reagent support the same? From my limited understanding it'd basically beThis would enable implementing elegant reactive behavior over JS libraries, websockets, localstorage, you name it. Anything that supports taking the value and notifying changes.
Note that
notify-deref-watcher!
itself is a private function, so it's currently not kosher to implement this externally.The text was updated successfully, but these errors were encountered: