a example of extending the event

2016-12-29  本文已影响23人  stone_yao

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
上一篇 下一篇

猜你喜欢

热点阅读