UNPKG

motion

Version:

motion - moving development forward

18 lines (16 loc) 306 B
'use babel' export class Disposable{ constructor(callback){ this.disposed = false this.callback = callback } dispose(){ if (!this.disposed) { this.disposed = true if(typeof this.callback === 'function'){ this.callback() } this.callback = null } } }