mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 00:31:20 -08:00
add Artplayer.LOG_VERSION
This commit is contained in:
1 parent
3179d1241e
commit
894a9db1d7
34 files changed
+182
-136
No files matched your search
@@ -1,7 +1,7 @@
|
||||
export default class Emitter {
|
||||
on(name, fn, ctx) {
|
||||
const e = this.e || (this.e = {});
|
||||
(e[name] || (e[name] = [])).push({ fn, ctx });
|
||||
const e = this.e ?? (this.e = {});
|
||||
(e[name] ?? (e[name] = [])).push({ fn, ctx });
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export default class Emitter {
|
||||
}
|
||||
|
||||
emit(name, ...data) {
|
||||
const evtArr = ((this.e || (this.e = {}))[name] || []).slice();
|
||||
const evtArr = ((this.e ?? (this.e = {}))[name] ?? []).slice();
|
||||
for (let i = 0; i < evtArr.length; i += 1) {
|
||||
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
||||
}
|
||||
@@ -24,7 +24,7 @@ export default class Emitter {
|
||||
}
|
||||
|
||||
off(name, callback) {
|
||||
const e = this.e || (this.e = {});
|
||||
const e = this.e ?? (this.e = {});
|
||||
const evts = e[name];
|
||||
const liveEvents = [];
|
||||
if (evts && callback) {
|
||||
|
||||
Reference in new issue
Block a user