🐛 Fix library color selector

This commit is contained in:
Eva 2022-09-22 13:21:27 +02:00
parent f3115f8f3a
commit 6e33d5b311
4 changed files with 23 additions and 25 deletions

View file

@ -300,13 +300,13 @@
[key default]
(let [id (use-id)
state (mf/use-state (get @storage key default))
stream (mf/with-memo []
stream (mf/with-memo [id]
(->> mbc/stream
(rx/filter #(= (:type %) key))
(rx/filter #(not= (:id %) id))
(rx/filter #(= (:type %) key))
(rx/map deref)))]
(mf/with-effect [@state key]
(mf/with-effect [@state key id]
(mbc/emit! id key @state)
(swap! storage assoc key @state))