     @file = new File(filePath)
     @uri = "file://" + encodeURI(filePath.replace(/\\/g, '/')).replace(/#/g, '%23').replace(/\?/g, '%3F')
     @subscriptions = new CompositeDisposable()
+    @emitter = new Emitter
 
   serialize: ->
     {filePath: @getPath(), deserializer: @constructor.name}
 
   getViewClass: ->
     require './image-editor-view'
+
+  terminatePendingState: ->
+    @emitter.emit 'did-terminate-pending-state' if this.isEqual(atom.workspace.getActivePane().getPendingItem())
+
+  onDidTerminatePendingState: (callback) ->
+    @emitter.on 'did-terminate-pending-state', callback
 
   # Register a callback for when the image file changes
   onDidChange: (callback) ->

  # Returns a {Boolean}.
  isEqual: (other) ->
    other instanceof ImageEditor and @getURI() is other.getURI()

path = require 'path'
fs = require 'fs-plus'
{Emitter, File, CompositeDisposable} = require 'atom'

# Editor model for an image file
module.exports =
