diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/control/concurrency/stm.lux | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/stdlib/source/lux/control/concurrency/stm.lux b/stdlib/source/lux/control/concurrency/stm.lux index f54e16baf..31a62413e 100644 --- a/stdlib/source/lux/control/concurrency/stm.lux +++ b/stdlib/source/lux/control/concurrency/stm.lux @@ -52,18 +52,14 @@ (wrap [])) (write! new-value (:abstraction var))))) - ## TODO: Remove when possible - (def: (helper|follow var) - (All [a] (-> (Var a) (frp.Channel a))) - (frp.channel [])) (def: #export (follow target) {#.doc "Creates a channel that will receive all changes to the value of the given var."} (All [a] (-> (Var a) (IO (frp.Channel a)))) (do io.Monad<IO> - [#let [channel (helper|follow target) + [#let [[channel source] (frp.channel []) target (:representation target)] _ (atom.update (function (_ [value observers]) - [value (#.Cons (frp.publish channel) observers)]) + [value (#.Cons (frp.feed source) observers)]) target)] (wrap channel))) ) |