     @context = context
     @method = method
     @args = args
-    @flatDeps = null
 
   dependsOn = (o, b) ->
-    if !@flatDeps?
-      @flatDeps = {}
-      @collectDeps o
-    return @flatDeps[b.id]
+    for dep in o.internalDeps()
+      if dep is b or dep.dependsOn(b)
+        return true
 
   apply: (obs) ->
     that = @

        else
          spawn event
    composite.unsubscribe


class EventStream extends Observable

Observable :: assign = Observable :: onValue

flatMap_ = (root, f, firstOnly, limit) ->
  result = new EventStream describe(root, "flatMap" + (if firstOnly then "First" else ""), f), (sink) ->
    composite = new CompositeUnsubscribe()
    queue = []
    spawn = (event) ->
      child = makeObservable(f event.value())
      extraDeps.push(child)
      composite.add (unsubAll, unsubMe) -> child.subscribeInternal (event) ->
        if event.isEnd()
          _.remove(child, extraDeps)
          checkQueue()
          checkEnd(unsubMe)
          Bacon.noMore
