定时炸弹
创建定时炸弹并听取他们的声音 :collision:
根据需要更详细的描述或注释。
安装
$ npm install --save time-bombs
用法
const timeBombs = require ( 'time-bomb' )
// create the first bomb
const bomb1 = timeBombs . create ( 100 , function ( ) {
console . log ( 'This will not be called' )
} )
// deactivate it before it explodes!
setTimeout ( function ( ) {
bomb1 . deactivate ( )
} , 50 )
// create a second bomb
const bomb2 = timeBombs .