Thanks. I just added some documentation and two more macros.
user> (use '[reaction.core]) nil reaction.core> (def-reactive! my-int 1) #'reaction.core/my-int reaction.core> (push! my-int inc inc) nil reaction.core> @my-int 3 reaction.core> (pop! my-int) nil reaction.core> @my-int 2 reaction.core> (pop! my-int) nil reaction.core> @my-int 1 reaction.core> (push! my-int inc (partial + 5) dec) nil reaction.core> @my-int 6 reaction.core> (pop! my-int 3) nil reaction.core> @my-int 1
22.11.2013, 22:52, "Marc Limotte" <mslimo...@gmail.com>:
Very clever. Thanks for the contribution.On Fri, Nov 22, 2013 at 1:20 AM, Kelker Ryan <theinter...@yandex.com> wrote:Reaction - https://github.com/runexec/reaction
A small reactive programming library for Clojure
Usage
user> (use '[reaction.core])
nil
user> (def-reactive! my-int 123)
#'user/my-int
user> @my-int
123
user> (rapply! my-int inc)
nil
user> @my-int
124
user> (original-value my-int)
123
user> @my-int
124
user> (rapply! my-int #(+ 5 %))
nil
user> @my-int
129
user> (defn reactive-minus-2 [] (- @my-int 2))
#'user/reactive-minus-2
user> (reactive-minus-2)
127
user> (rapply! my-int #(- % 20))
nil
user> @my-int
109
user> (reactive-minus-2)
107
user> (rset! my-int 1)
nil
user> (remove-actions! my-int)
nil
user> @my-int
1
user> (rapply! my-int inc)
nil
user> @my-int
2
user> (remove-actions! my-int)
nil
user> @my-int
1
user>--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.