{
  "classes": {
    "CompositeDisposable": {
      "name": "CompositeDisposable",
      "superClass": null,
      "filename": "lib/composite-disposable.js",
      "srcUrl": "https://github.com/atom/event-kit/blob/v2.5.3/lib/composite-disposable.js#L27",
      "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/v2.5.3/lib/composite-disposable.js#L33",
          "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/v2.5.3/lib/composite-disposable.js#L44",
          "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/v2.5.3/lib/composite-disposable.js#L62",
          "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/v2.5.3/lib/composite-disposable.js#L75",
          "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": "delete",
          "sectionName": "Managing Disposables",
          "srcUrl": "https://github.com/atom/event-kit/blob/v2.5.3/lib/composite-disposable.js#L82",
          "visibility": "Public",
          "summary": "Alias to {CompositeDisposable::remove}",
          "description": "Alias to {CompositeDisposable::remove}"
        },
        {
          "name": "clear",
          "sectionName": "Managing Disposables",
          "srcUrl": "https://github.com/atom/event-kit/blob/v2.5.3/lib/composite-disposable.js#L88",
          "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": "js",
          "code": "const {CompositeDisposable} = require('atom')\n\nclass Something {\n  constructor() {\n    this.disposables = new CompositeDisposable()\n    const editor = atom.workspace.getActiveTextEditor()\n    this.disposables.add(editor.onDidChange(() => {})\n    this.disposables.add(editor.onDidChangePath(() => {})\n  }\n\n  destroy() {\n    this.disposables.dispose();\n  }\n}",
          "raw": "```js\nconst {CompositeDisposable} = require('atom')\n\nclass Something {\n  constructor() {\n    this.disposables = new CompositeDisposable()\n    const editor = atom.workspace.getActiveTextEditor()\n    this.disposables.add(editor.onDidChange(() => {})\n    this.disposables.add(editor.onDidChangePath(() => {})\n  }\n\n  destroy() {\n    this.disposables.dispose();\n  }\n}\n```"
        }
      ]
    },
    "Disposable": {
      "name": "Disposable",
      "superClass": null,
      "filename": "lib/disposable.js",
      "srcUrl": "https://github.com/atom/event-kit/blob/v2.5.3/lib/disposable.js#L3",
      "sections": [
        {
          "name": "Construction and Destruction",
          "description": ""
        }
      ],
      "classMethods": [
        {
          "name": "isDisposable",
          "sectionName": null,
          "srcUrl": "https://github.com/atom/event-kit/blob/v2.5.3/lib/disposable.js#L10",
          "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/v2.5.3/lib/disposable.js#L22",
          "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/v2.5.3/lib/disposable.js#L32",
          "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",
      "superClass": null,
      "filename": "lib/emitter.js",
      "srcUrl": "https://github.com/atom/event-kit/blob/v2.5.3/lib/emitter.js#L31",
      "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/v2.5.3/lib/emitter.js#L73",
          "visibility": "Public",
          "summary": "Construct an emitter.",
          "description": "Construct an emitter.\n\n```js\nthis.emitter = new Emitter()\n```"
        },
        {
          "name": "clear",
          "sectionName": "Construction and Destruction",
          "srcUrl": "https://github.com/atom/event-kit/blob/v2.5.3/lib/emitter.js#L79",
          "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/v2.5.3/lib/emitter.js#L88",
          "visibility": "Public",
          "summary": "Unsubscribe all handlers.",
          "description": "Unsubscribe all handlers."
        },
        {
          "name": "on",
          "sectionName": "Event Subscription",
          "srcUrl": "https://github.com/atom/event-kit/blob/v2.5.3/lib/emitter.js#L107",
          "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": "once",
          "sectionName": "Event Subscription",
          "srcUrl": "https://github.com/atom/event-kit/blob/v2.5.3/lib/emitter.js#L152",
          "visibility": "Public",
          "summary": "Register the given handler function to be invoked the next time an\nevents with the given name is emitted via {::emit}.",
          "description": "Register the given handler function to be invoked the next time an\nevents with the given name is 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/v2.5.3/lib/emitter.js#L183",
          "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/v2.5.3/lib/emitter.js#L214",
          "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```js\nclass User {\n  constructor() {\n    this.emitter = new Emitter()\n  }\n\n  onDidChangeName(callback) {\n    this.emitter.on('did-change-name', callback)\n  }\n\n  setName(name) {\n    if (name !== this.name) {\n      this.name = name\n      this.emitter.emit('did-change-name', name)\n    }\n\n    return this.name\n  }\n}\n```"
    }
  }
}