SyncHook
简单示例
const { SyncHook } = require('tapable');
const hook = new SyncHook(['name', 'age']);
hook.tap('1', (name, age) => {
console.log('1===>', name, age);
});
hook.tap('2', (name, age) => {
console.log('2===>', name, age);
});
hook.tap('3', (name, age) => {
console.log('3===>', name, age);
});
hook.call('zce', 100);
1===> zce 100
2===> zce 100
3===> zce 100