This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import EventEmitter from 'eventemitter3'; | |
const EventEmitter = require('eventemitter3'); | |
/** | |
* @private | |
*/ | |
const DEFAULT = { | |
INTERVAL: 1000, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const InstantTask = require('./InstantTask'); | |
const instantTask = new InstantTask(); | |
console.log('添加任务 instant1'); | |
instantTask.addTask({ | |
name: 'instant1', | |
type: 'once', | |
callback: (task) => { | |
console.log(`${task.name} run`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 前端使用 | |
const EventEmitter = require('eventemitter3'); | |
// node使用 | |
const EventEmitter = require('events'); | |
/** | |
* 默认配置, 本组件不存在于是设为空 | |
* @private | |
*/ | |
const DEFAULT = { |