{"size": 474, "ext": "js", "max_stars_repo_path": "webpack/6.tapable/2.SyncBailHook.js", "max_stars_repo_name": "wangtongmeng/front-end-practice", "max_stars_repo_stars_event_min_datetime": "2020-11-19T11:59:19.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-05T03:36:12.000Z", "max_issues_repo_path": "webpack/6.tapable/2.SyncBailHook.js", "max_issues_repo_name": "wangtongmeng/front-end-practice", "max_issues_repo_issues_event_min_datetime": "2020-06-22T05:04:11.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T19:15:40.000Z", "max_forks_repo_path": "webpack/6.tapable/2.SyncBailHook.js", "max_forks_repo_name": "wangtongmeng/front-end-practice", "max_forks_repo_forks_event_min_datetime": "2019-09-27T02:19:43.000Z", "max_forks_repo_forks_event_max_datetime": "2019-09-27T02:19:44.000Z"}
{"max_stars_count": 2, "max_issues_count": 113, "max_forks_count": 2, "avg_line_length": 23.7, "max_line_length": 50, "alphanum_fraction": 0.6160337553}
const { SyncBailHook } = require('tapable');
//参数是一个数组,参数长度有用,代表取真实的call的参数的个数,数组里字符串的名字没用
const syncHook = new SyncBailHook(['name','age']);
//注册事件函数
syncHook.tap('1', (name, age) => { //  events on
    console.log(1, name, age);
});
syncHook.tap('2', (name, age) => {
    console.log(2, name, age);
    return '2';
});
syncHook.tap('3', (name, age) => {
    console.log(3, name, age);
});
//触发事件函数
syncHook.call('zhangsan', 12); // emit


// 1 zhangsan 12
// 2 zhangsan 12