forked from video-dev/hls.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove events/EventEmitter && move Observer to ts (video-dev#2097)
* remove events/EventEmitter && move Observer to ts * disable node modules in webpack
- Loading branch information
1 parent
0bbb9b8
commit 48f64de
Showing
7 changed files
with
27 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { EventEmitter } from 'eventemitter3'; | ||
|
||
/** | ||
* Simple adapter sub-class of Nodejs-like EventEmitter. | ||
*/ | ||
export class Observer extends EventEmitter { | ||
/** | ||
* We simply want to pass along the event-name itself | ||
* in every call to a handler, which is the purpose of our `trigger` method | ||
* extending the standard API. | ||
*/ | ||
trigger (event: string, ...data: Array<any>): void { | ||
this.emit(event, event, ...data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters