]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/ex-mode/node_modules/event-kit/lib/disposable.js
4 Grim
= require('grim');
6 module
.exports
= Disposable
= (function() {
7 Disposable
.prototype.disposed
= false;
11 Section: Construction and Destruction
14 function Disposable(disposalAction
) {
15 this.disposalAction
= disposalAction
;
18 Disposable
.prototype.dispose = function() {
21 return typeof this.disposalAction
=== "function" ? this.disposalAction() : void 0;
25 Disposable
.prototype.off = function() {
26 Grim
.deprecate("Use ::dispose to cancel subscriptions instead of ::off");
27 return this.dispose();