{
  "classes": {
    "CompositeDisposable": {
      "name": "CompositeDisposable",
      "filename": "src/composite-disposable.coffee",
      "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/composite-disposable.coffee#L22",
      "sections": [
        {
          "name": "Construction and Destruction",
          "description": ""
        },
        {
          "name": "Managing Disposables",
          "description": ""
        }
      ],
      "classMethods": [],
      "instanceMethods": [
        {
          "name": "constructor",
          "sectionName": "Construction and Destruction",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/composite-disposable.coffee#L30",
          "visibility": "Public",
          "summary": "Construct an instance, optionally with one or more disposables ",
          "description": "Construct an instance, optionally with one or more disposables "
        },
        {
          "name": "dispose",
          "sectionName": "Construction and Destruction",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/composite-disposable.coffee#L37",
          "visibility": "Public",
          "summary": "Dispose all disposables added to this composite disposable.",
          "description": "Dispose all disposables added to this composite disposable.\n\nIf this object has already been disposed, this method has no effect. "
        },
        {
          "name": "add",
          "sectionName": "Managing Disposables",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/composite-disposable.coffee#L55",
          "visibility": "Public",
          "summary": "Add disposables to be disposed when the composite is disposed.",
          "description": "Add disposables to be disposed when the composite is disposed.\n\nIf this object has already been disposed, this method has no effect.",
          "arguments": [
            {
              "name": "...disposables",
              "description": "{Disposable} instances or any objects with `.dispose()` methods. ",
              "type": "Disposable",
              "isOptional": false
            }
          ]
        },
        {
          "name": "remove",
          "sectionName": "Managing Disposables",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/composite-disposable.coffee#L64",
          "visibility": "Public",
          "summary": "Remove a previously added disposable.",
          "description": "Remove a previously added disposable.",
          "arguments": [
            {
              "name": "disposable",
              "description": "{Disposable} instance or any object with a `.dispose()` method. ",
              "type": "Disposable",
              "isOptional": false
            }
          ]
        },
        {
          "name": "clear",
          "sectionName": "Managing Disposables",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/composite-disposable.coffee#L70",
          "visibility": "Public",
          "summary": "Clear all disposables. They will not be disposed by the next call\nto dispose. ",
          "description": "Clear all disposables. They will not be disposed by the next call\nto dispose. "
        }
      ],
      "classProperties": [],
      "instanceProperties": [],
      "visibility": "Essential",
      "summary": "An object that aggregates multiple {Disposable} instances together\ninto a single disposable, so they can all be disposed as a group.",
      "description": "An object that aggregates multiple {Disposable} instances together\ninto a single disposable, so they can all be disposed as a group.\n\nThese are very useful when subscribing to multiple events.",
      "examples": [
        {
          "description": "",
          "lang": "coffee",
          "code": "{CompositeDisposable} = require 'atom'\n\nclass Something\n  constructor: ->\n    @disposables = new CompositeDisposable\n    editor = atom.workspace.getActiveTextEditor()\n    @disposables.add editor.onDidChange ->\n    @disposables.add editor.onDidChangePath ->\n\n  destroy: ->\n    @disposables.dispose()",
          "raw": "```coffee\n{CompositeDisposable} = require 'atom'\n\nclass Something\n  constructor: ->\n    @disposables = new CompositeDisposable\n    editor = atom.workspace.getActiveTextEditor()\n    @disposables.add editor.onDidChange ->\n    @disposables.add editor.onDidChangePath ->\n\n  destroy: ->\n    @disposables.dispose()\n```"
        }
      ]
    },
    "Disposable": {
      "name": "Disposable",
      "filename": "src/disposable.coffee",
      "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/disposable.coffee#L6",
      "sections": [
        {
          "name": "Construction and Destruction",
          "description": ""
        }
      ],
      "classMethods": [
        {
          "name": "isDisposable",
          "sectionName": null,
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/disposable.coffee#L15",
          "visibility": "Public",
          "summary": "Ensure that `object` correctly implements the `Disposable`\ncontract.",
          "description": "Ensure that `object` correctly implements the `Disposable`\ncontract.",
          "arguments": [
            {
              "name": "object",
              "description": "An {Object} you want to perform the check against.",
              "type": "Object",
              "isOptional": false
            }
          ],
          "returnValues": [
            {
              "type": "Boolean",
              "description": "Returns a {Boolean} indicating whether `object` is a valid `Disposable`."
            }
          ]
        }
      ],
      "instanceMethods": [
        {
          "name": "constructor",
          "sectionName": "Construction and Destruction",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/disposable.coffee#L26",
          "visibility": "Public",
          "summary": "Construct a Disposable",
          "description": "Construct a Disposable",
          "arguments": [
            {
              "name": "disposalAction",
              "description": "A {Function} to call when {::dispose} is called for the first time. ",
              "type": "Function",
              "isOptional": false
            }
          ]
        },
        {
          "name": "dispose",
          "sectionName": "Construction and Destruction",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/disposable.coffee#L33",
          "visibility": "Public",
          "summary": "Perform the disposal action, indicating that the resource associated\nwith this disposable is no longer needed.",
          "description": "Perform the disposal action, indicating that the resource associated\nwith this disposable is no longer needed.\n\nYou can call this method more than once, but the disposal action will only\nbe performed the first time. "
        }
      ],
      "classProperties": [],
      "instanceProperties": [],
      "visibility": "Essential",
      "summary": "A handle to a resource that can be disposed. For example,\n{Emitter::on} returns disposables representing subscriptions. ",
      "description": "A handle to a resource that can be disposed. For example,\n{Emitter::on} returns disposables representing subscriptions. "
    },
    "Emitter": {
      "name": "Emitter",
      "filename": "src/emitter.coffee",
      "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/emitter.coffee#L25",
      "sections": [
        {
          "name": "Construction and Destruction",
          "description": ""
        },
        {
          "name": "Event Subscription",
          "description": ""
        },
        {
          "name": "Event Emission",
          "description": ""
        }
      ],
      "classMethods": [],
      "instanceMethods": [
        {
          "name": "constructor",
          "sectionName": "Construction and Destruction",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/emitter.coffee#L62",
          "visibility": "Public",
          "summary": "Construct an emitter.",
          "description": "Construct an emitter.\n\n```coffee\n@emitter = new Emitter()\n```"
        },
        {
          "name": "clear",
          "sectionName": "Construction and Destruction",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/emitter.coffee#L66",
          "visibility": "Public",
          "summary": "Clear out any existing subscribers. ",
          "description": "Clear out any existing subscribers. "
        },
        {
          "name": "dispose",
          "sectionName": "Construction and Destruction",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/emitter.coffee#L70",
          "visibility": "Public",
          "summary": "Unsubscribe all handlers. ",
          "description": "Unsubscribe all handlers. "
        },
        {
          "name": "on",
          "sectionName": "Event Subscription",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/emitter.coffee#L87",
          "visibility": "Public",
          "summary": "Register the given handler function to be invoked whenever events by\nthe given name are emitted via {::emit}.",
          "description": "Register the given handler function to be invoked whenever events by\nthe given name are emitted via {::emit}.",
          "arguments": [
            {
              "name": "eventName",
              "description": "{String} naming the event that you want to invoke the handler when emitted.",
              "type": "String",
              "isOptional": false
            },
            {
              "name": "handler",
              "description": "{Function} to invoke when {::emit} is called with the given event name.",
              "type": "Function",
              "isOptional": false
            }
          ],
          "returnValues": [
            {
              "type": "Disposable",
              "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
            }
          ]
        },
        {
          "name": "preempt",
          "sectionName": "Event Subscription",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/emitter.coffee#L121",
          "visibility": "Public",
          "summary": "Register the given handler function to be invoked *before* all\nother handlers existing at the time of subscription whenever events by the\ngiven name are emitted via {::emit}.",
          "description": "Register the given handler function to be invoked *before* all\nother handlers existing at the time of subscription whenever events by the\ngiven name are emitted via {::emit}.\n\nUse this method when you need to be the first to handle a given event. This\ncould be required when a data structure in a parent object needs to be\nupdated before third-party event handlers registered on a child object via a\npublic API are invoked. Your handler could itself be preempted via\nsubsequent calls to this method, but this can be controlled by keeping\nmethods based on `::preempt` private.",
          "arguments": [
            {
              "name": "eventName",
              "description": "{String} naming the event that you want to invoke the handler when emitted.",
              "type": "String",
              "isOptional": false
            },
            {
              "name": "handler",
              "description": "{Function} to invoke when {::emit} is called with the given event name.",
              "type": "Function",
              "isOptional": false
            }
          ],
          "returnValues": [
            {
              "type": "Disposable",
              "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
            }
          ]
        },
        {
          "name": "emit",
          "sectionName": "Event Emission",
          "srcUrl": "https://github.com/atom/event-kit/blob/v1.5.0/src/emitter.coffee#L144",
          "visibility": "Public",
          "summary": "Invoke handlers registered via {::on} for the given event name.",
          "description": "Invoke handlers registered via {::on} for the given event name.",
          "arguments": [
            {
              "name": "eventName",
              "description": "The name of the event to emit. Handlers registered with {::on} for the same name will be invoked.",
              "type": null,
              "isOptional": false
            },
            {
              "name": "value",
              "description": "Callbacks will be invoked with this value as an argument. ",
              "type": null,
              "isOptional": false
            }
          ]
        }
      ],
      "classProperties": [],
      "instanceProperties": [],
      "visibility": "Essential",
      "summary": "Utility class to be used when implementing event-based APIs that\nallows for handlers registered via `::on` to be invoked with calls to\n`::emit`. Instances of this class are intended to be used internally by\nclasses that expose an event-based API.",
      "description": "Utility class to be used when implementing event-based APIs that\nallows for handlers registered via `::on` to be invoked with calls to\n`::emit`. Instances of this class are intended to be used internally by\nclasses that expose an event-based API.\n\nFor example:\n\n```coffee\nclass User\n  constructor: ->\n    @emitter = new Emitter\n\n  onDidChangeName: (callback) ->\n    @emitter.on 'did-change-name', callback\n\n  setName: (name) ->\n    if name isnt @name\n      @name = name\n      @emitter.emit 'did-change-name', name\n    @name\n```"
    }
  }
}