mirror of
https://github.com/pionxzh/chatgpt-exporter.git
synced 2026-07-23 09:00:51 -05:00
refactor: replace eventemitter3 w/ mitt
This commit is contained in:
@@ -32,7 +32,6 @@
|
|||||||
"@headlessui/react": "^1.7.14",
|
"@headlessui/react": "^1.7.14",
|
||||||
"@radix-ui/react-dialog": "^1.0.3",
|
"@radix-ui/react-dialog": "^1.0.3",
|
||||||
"@radix-ui/react-hover-card": "^1.0.5",
|
"@radix-ui/react-hover-card": "^1.0.5",
|
||||||
"eventemitter3": "^5.0.1",
|
|
||||||
"hast-util-to-html": "^8.0.4",
|
"hast-util-to-html": "^8.0.4",
|
||||||
"html2canvas": "^1.4.1",
|
"html2canvas": "^1.4.1",
|
||||||
"i18next": "^22.5.1",
|
"i18next": "^22.5.1",
|
||||||
@@ -44,6 +43,7 @@
|
|||||||
"mdast-util-to-hast": "^12.3.0",
|
"mdast-util-to-hast": "^12.3.0",
|
||||||
"mdast-util-to-markdown": "^1.5.0",
|
"mdast-util-to-markdown": "^1.5.0",
|
||||||
"micromark-extension-gfm": "^2.0.3",
|
"micromark-extension-gfm": "^2.0.3",
|
||||||
|
"mitt": "^3.0.1",
|
||||||
"preact": "^10.17.1",
|
"preact": "^10.17.1",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
|
|||||||
11
pnpm-lock.yaml
generated
11
pnpm-lock.yaml
generated
@@ -14,9 +14,6 @@ dependencies:
|
|||||||
'@radix-ui/react-hover-card':
|
'@radix-ui/react-hover-card':
|
||||||
specifier: ^1.0.5
|
specifier: ^1.0.5
|
||||||
version: 1.0.5(react-dom@18.3.1)(react@18.3.1)
|
version: 1.0.5(react-dom@18.3.1)(react@18.3.1)
|
||||||
eventemitter3:
|
|
||||||
specifier: ^5.0.1
|
|
||||||
version: 5.0.1
|
|
||||||
hast-util-to-html:
|
hast-util-to-html:
|
||||||
specifier: ^8.0.4
|
specifier: ^8.0.4
|
||||||
version: 8.0.4
|
version: 8.0.4
|
||||||
@@ -50,6 +47,9 @@ dependencies:
|
|||||||
micromark-extension-gfm:
|
micromark-extension-gfm:
|
||||||
specifier: ^2.0.3
|
specifier: ^2.0.3
|
||||||
version: 2.0.3
|
version: 2.0.3
|
||||||
|
mitt:
|
||||||
|
specifier: ^3.0.1
|
||||||
|
version: 3.0.1
|
||||||
preact:
|
preact:
|
||||||
specifier: ^10.17.1
|
specifier: ^10.17.1
|
||||||
version: 10.17.1
|
version: 10.17.1
|
||||||
@@ -2874,6 +2874,7 @@ packages:
|
|||||||
|
|
||||||
/eventemitter3@5.0.1:
|
/eventemitter3@5.0.1:
|
||||||
resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
|
resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/execa@5.1.1:
|
/execa@5.1.1:
|
||||||
resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}
|
resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==}
|
||||||
@@ -4506,6 +4507,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/mitt@3.0.1:
|
||||||
|
resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/mlly@1.4.2:
|
/mlly@1.4.2:
|
||||||
resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==}
|
resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import EventEmitter from 'eventemitter3'
|
import EventEmitter from 'mitt'
|
||||||
import { sleep } from './utils'
|
import { sleep } from './utils'
|
||||||
|
|
||||||
type RequestFn<T> = () => Promise<T>
|
type RequestFn<T> = () => Promise<T>
|
||||||
@@ -14,7 +14,11 @@ interface ProgressEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class RequestQueue<T> {
|
export class RequestQueue<T> {
|
||||||
private eventEmitter = new EventEmitter()
|
private eventEmitter = EventEmitter<{
|
||||||
|
done: T[]
|
||||||
|
progress: ProgressEvent
|
||||||
|
} & Record<string, any[]>>()
|
||||||
|
|
||||||
private queue: Array<RequestObject<T>> = []
|
private queue: Array<RequestObject<T>> = []
|
||||||
private results: T[] = []
|
private results: T[] = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user