3 "CompositeDisposable": {
4 "name": "CompositeDisposable",
5 "filename": "src/composite-disposable.coffee",
6 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/composite-disposable.coffee#L4",
9 "name": "Construction and Destruction",
13 "name": "Managing Disposables",
20 "name": "constructor",
21 "sectionName": "Construction and Destruction",
22 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/composite-disposable.coffee#L12",
23 "visibility": "Public",
24 "summary": "Construct an instance, optionally with one or more ",
25 "description": "Construct an instance, optionally with one or more "
29 "sectionName": "Construction and Destruction",
30 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/composite-disposable.coffee#L19",
31 "visibility": "Public",
32 "summary": "Dispose all disposables added to this composite disposable.",
33 "description": "Dispose all disposables added to this composite disposable.\n\nIf this object has already been disposed, this method has no effect. "
37 "sectionName": "Managing Disposables",
38 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/composite-disposable.coffee#L35",
39 "visibility": "Public",
40 "summary": "Add a disposable to be disposed when the composite is disposed.",
41 "description": "Add a disposable to be disposed when the composite is disposed.\n\nIf this object has already been disposed, this method has no effect.",
45 "description": "{Disposable} instance or any object with a `.dispose()` method. ",
53 "sectionName": "Managing Disposables",
54 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/composite-disposable.coffee#L43",
55 "visibility": "Public",
56 "summary": "Remove a previously added disposable.",
57 "description": "Remove a previously added disposable.",
61 "description": "{Disposable} instance or any object with a `.dispose()` method. ",
69 "sectionName": "Managing Disposables",
70 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/composite-disposable.coffee#L49",
71 "visibility": "Public",
72 "summary": "Clear all disposables. They will not be disposed by the next call\nto dispose. ",
73 "description": "Clear all disposables. They will not be disposed by the next call\nto dispose. "
76 "classProperties": [],
77 "instanceProperties": [],
78 "visibility": "Essential",
79 "summary": "An object that aggregates multiple {Disposable} instances together\ninto a single disposable, so they can all be disposed as a group. ",
80 "description": "An object that aggregates multiple {Disposable} instances together\ninto a single disposable, so they can all be disposed as a group. "
84 "filename": "src/disposable.coffee",
85 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/disposable.coffee#L6",
88 "name": "Construction and Destruction",
95 "name": "constructor",
96 "sectionName": "Construction and Destruction",
97 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/disposable.coffee#L17",
98 "visibility": "Public",
99 "summary": "Construct a Disposable",
100 "description": "Construct a Disposable",
103 "name": "disposalAction",
104 "description": "An action to perform when {::dispose} is called for the first time. ",
112 "sectionName": "Construction and Destruction",
113 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/disposable.coffee#L24",
114 "visibility": "Public",
115 "summary": "Perform the disposal action, indicating that the resource associated\nwith this disposable is no longer needed.",
116 "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. "
119 "classProperties": [],
120 "instanceProperties": [],
121 "visibility": "Essential",
122 "summary": "A handle to a resource that can be disposed. For example,\n{Emitter::on} returns disposables representing subscriptions. ",
123 "description": "A handle to a resource that can be disposed. For example,\n{Emitter::on} returns disposables representing subscriptions. "
127 "filename": "src/emitter.coffee",
128 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/emitter.coffee#L25",
131 "name": "Construction and Destruction",
135 "name": "Event Subscription",
139 "name": "Event Emission",
146 "name": "constructor",
147 "sectionName": "Construction and Destruction",
148 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/emitter.coffee#L37",
149 "visibility": "Public",
150 "summary": "Construct an emitter.",
151 "description": "Construct an emitter.\n\n```coffee\n@emitter = new Emitter()\n```"
155 "sectionName": "Construction and Destruction",
156 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/emitter.coffee#L41",
157 "visibility": "Public",
158 "summary": "Unsubscribe all handlers. ",
159 "description": "Unsubscribe all handlers. "
163 "sectionName": "Event Subscription",
164 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/emitter.coffee#L58",
165 "visibility": "Public",
166 "summary": "Register the given handler function to be invoked whenever events by\nthe given name are emitted via {::emit}.",
167 "description": "Register the given handler function to be invoked whenever events by\nthe given name are emitted via {::emit}.",
171 "description": "{String} naming the event that you want to invoke the handler when emitted.",
177 "description": "{Function} to invoke when {::emit} is called with the given event name.",
184 "type": "Disposable",
185 "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
191 "sectionName": "Event Emission",
192 "srcUrl": "https://github.com/atom/event-kit/blob/v0.7.2/src/emitter.coffee#L91",
193 "visibility": "Public",
194 "summary": "Invoke handlers registered via {::on} for the given event name.",
195 "description": "Invoke handlers registered via {::on} for the given event name.",
199 "description": "The name of the event to emit. Handlers registered with {::on} for the same name will be invoked.",
205 "description": "Callbacks will be invoked with this value as an argument. ",
212 "classProperties": [],
213 "instanceProperties": [],
214 "visibility": "Essential",
215 "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.",
216 "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```"