mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: update eslint rules
This commit is contained in:
1 parent
0e07c64cad
commit
5e8d2b1286
30 files changed
+73
-72
No files matched your search
@@ -1,5 +1,6 @@
|
||||
/* eslint-disable no-await-in-loop */
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const _hooks: Record<keyof any, Array<(...args: any[]) => any>> = {};
|
||||
|
||||
function isBailed(value: any) {
|
||||
@@ -45,12 +46,12 @@ export function prependListener<K extends keyof EventMap>(name: K, listener: Eve
|
||||
|
||||
export function once<K extends keyof EventMap>(name: K, listener: EventMap[K]) {
|
||||
let dispose;
|
||||
function _listener(...args: any[]) {
|
||||
function l(...args: any[]) {
|
||||
dispose();
|
||||
return listener.apply(this, args);
|
||||
}
|
||||
_listener.toString = () => `// Once \n${listener.toString()}`;
|
||||
dispose = addListener(name, _listener);
|
||||
l.toString = () => `// Once \n${listener.toString()}`;
|
||||
dispose = addListener(name, l);
|
||||
return dispose;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user