             delete @editorCloseSubscriptions[editor.id]
     else
       if @editorCreationSubscription
-        @editorCreationSubscription.off()
+        @editorCreationSubscription.dispose()
         @editorCreationSubscription = null
 
         for subscriptionId, subscription of @editorSaveSubscriptions

FileTypeNotSupportedView = require './not-supported-view'

jsbeautify = (require 'js-beautify').js_beautify



  subscribeToEvents: (state) ->
    if atom.config.get('jsformat.format_on_save') ? @configDefaults['format_on_save']
      @editorCreationSubscription = atom.workspace.observeTextEditors (editor) =>
        grammar = editor.getGrammar().scopeName

        if grammar is 'source.js' or grammar is 'source.json'
