     @listVariables()
     @listFunctions()
 
+    # TODO: Stop all watchers when changed core/logged out
+
     atom.workspaceView.command 'spark-ide:update-core-status', =>
       @listVariables()
       @listFunctions()

  refreshVariable: (variableName) ->
    dfd = whenjs.defer()
    @client ?= new ApiClient SettingsHelper.get('apiUrl'), SettingsHelper.get('access_token')

    cell = @find('#spark-ide-cloud-variables [data-id=' + variableName + '] td:eq(2)')
    cell.addClass 'loading'
    promise = @client.getVariable SettingsHelper.get('current_core'), variableName
    promise.done (e) =>
      if !!e.ok

    atom.workspaceView.command 'spark-ide:logout', =>
      if @hasParent()
        @detach()

    @watchers = {}

  serialize: ->

