美文网首页
a example of extending the event

a example of extending the event

作者: stone_yao | 来源:发表于2016-12-29 22:54 被阅读23次

There are three steps to extending an event emitter.
1.create a class constructor
2.inheriting the event emitter's behavior
3.extending the behavior

example:I create a class called Watcherthat would monitor a directory.If any changes in the directory,Watcherwill rename any files in it to lowercase, and then remove the files into a separate specific directory.

WechatIMG75.jpeg

相关文章

网友评论

      本文标题:a example of extending the event

      本文链接:https://www.haomeiwen.com/subject/fzbpvttx.html