export class Disposal { constructor ( private dispose = [ ] ) { } add ( callback ) { this . dispose . push ( callback ) ; } empty ( ) { this . dispose . forEach ( fn => fn ( ) ) ; this . dispose = [ ] ; } }