]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/node_modules/event-kit/lib/disposable.js
4ccb3da2043c5de6b8c69fc3b22c8e6d61c87135
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();