rum

Simple, decomplected, isomorphic HTML UI library for Clojure and ClojureScript | 0.12.8 https://github.com/tonsky/rum/blob/gh-pages/CHANGELOG.md#0128
g7s 2020-07-21T08:31:15.195600Z

@cmdrdats The pattern you describe is known (part of optimization of a component) and the issue you describe is also known as @roman01la said above.

g7s 2020-07-21T08:31:31.195800Z

Personally I use a hook that does the cleanup

g7s 2020-07-21T08:32:09.196Z

Something along the lines: https://github.com/g7s/rum/blob/hooks/src/rum/core.cljs#L572

cmdrdats 2020-07-21T08:35:00.196300Z

@g7s great, thanks for the feedback - use-derived-atom looks interesting - is this in a fork?

g7s 2020-07-21T08:35:45.196500Z

Yes it is in a fork that I had made long ago.

cmdrdats 2020-07-21T08:36:16.196700Z

ah, ok - I see the current rum code has:

(defn use-reducer [reducer-fn initial-value]
  [initial-value reducer-fn])

(defn use-effect!
  ([setup-fn])
  ([setup-fn deps]))

(defn use-callback
  ([callback] callback)
  ([callback deps] callback))

cmdrdats 2020-07-21T08:36:51.196900Z

probably in prep for moving away from React?

cmdrdats 2020-07-21T08:38:11.197100Z

I guess a similar effect might be achieved with a mixin if there's a registry of derived atoms against a component?

g7s 2020-07-21T08:38:47.197300Z

Yeah exactly you can do that with a mixin as you describe