         "tree-view:#{command}", => @clearFocusedElement()
 
   update: ->
-    promiseNextTick =>
+    promiseNextTick().then =>
       if @conf.pushEditor
         @treeViewEl.style.position = 'relative'
         atom.views.getView(@treeView.panel)?.style.width = ''

  res[key] = obj[key] for own key of obj
  res

promiseNextTick = (cb) ->
  new Promise (resolve) ->
    process.nextTick ->
      resolve()
  .then cb

class AutohideTreeView
  config:

    if @visible then @hide 0 else @show 0, disableHoverEvents

  resize: ->
    promiseNextTick.then() =>
      if @visible then @show(0) else @hide(0)
    .catch error

