Permalink
Browse files

Refactor to new interface.

  • Loading branch information...
1 parent 727b0a1 commit 999d45d4d0ee8f52567e47dbce88cb88b2949db5 @cmeiklejohn committed Mar 13, 2013
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/cljs/shafty/core.cljs
View
@@ -59,6 +59,15 @@
"Convert a behaviour back to an event stream."
(changes! [this]))
+(defprotocol IBehaviourGenerator
+ "Convert a behaviour back to an event stream and generate new
+ behaviours."
+ (not! [this init])
+ (delay! [this interval init])
+ (calm! [this interval init])
+ (blind! [this interval init])
+ (switch! [this init]))
+
(defprotocol IEventStream
"The composable stream interface provides a series of filtering and
selection methods for working with objects as they enter and leave the
@@ -291,7 +300,7 @@
(Behaviour. state stream (fn [me x] (propagate! me x)) nil)))
(extend-type Behaviour
- IEventStream
+ IBehaviourGenerator
(not! [this init]
(hold! (not! (changes! this)) init))

0 comments on commit 999d45d

Please sign in to comment.