 
 
   activate: (state) ->
+    @disposables = new CompositeDisposable
     atomAdaptions = notationalItems()
 
     notationalPanel = setupPanel(

        .merge(atoms.fromCommand('.atom-notational-search', 'core:move-up').map(-1))
    )

    @subscriptions.push.apply(@subscriptions, [
      atomAdaptions
      notationalPanel

      # Side effects
      # Create panel 1st time the element is created
      notationalPanel.elementProp.onValue (el) =>
        @panel = atom.workspace.addTopPanel(item: el) unless @panel

      # Persist resized body height
      notationalPanel.resizedBodyHeightProp.debounce(500).onValue (newHeight) ->
        atom.config.set('atom-notational.bodyHeight', newHeight)

      # Handle selected item
      notationalPanel.selectedItemProp.onValue (selectedItem) ->
        if selectedItem
          console.info selectedItem
    ])

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


module.exports =
  panel: undefined
  disposables: undefined

  config:
    bodyHeight:
