nodejs的事件实现类似:
app.use(function (req, res, next) {
cosole.log(res)
next()
})
app.post(...)
类似上面,需要实现类似的事件效果:
event.watch('all', cb)
event.watch('[event type]', cb)
就是监控所有事件并作出反馈但不会影响事件的单独执行。这里使用once和emit创建触发事件
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
业精于勤,荒于嬉;行成于思,毁于随。