 
 module.exports =
   panel: undefined
-  deactivateStream: undefined
+  deactivateBus: undefined
   subscriptions: []
 
   config:

    @subscriptions.push newBodyHeightStream.debounce(500).onValue (newHeight) ->
      atom.config.set('atom-notational.bodyHeight', newHeight)

    terminateProjectsProp = projectsProp.sampledBy(@deactivateStream)
    terminateProjectsProp.onValue (projects) ->
      for { task } in projects
        task.send('finish')


  deactivate: ->
    @deactivateStream.push(true)
    unsubscribe() for unsubscribe in subscriptions
    @panel?.destroy()



  activate: (state) ->
    @deactivateBus = new Bacon.Bus()

    { addedStream, removedStream } = atoms.projectsPaths()

