[TS] Use Symbol.for for emitterSymbol & syncAwaitSymbol (#130)

* [TS] Export emitterSymbol & syncAwaitSymbol

* [TS] Use Symbol.for instead

* [TS] Rename symbol names

Co-authored-by: Amsyar Rasyiq <82711525+amsyarasyiq@users.noreply.github.com>

---------

Co-authored-by: Amsyar Rasyiq <82711525+amsyarasyiq@users.noreply.github.com>
This commit is contained in:
Gabe616 2023-08-13 14:21:42 +02:00 committed by GitHub
parent ee76885287
commit 10b12474ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,8 +1,8 @@
import { Emitter, StorageBackend } from "@types"; import { Emitter, StorageBackend } from "@types";
import createEmitter from "@lib/emitter"; import createEmitter from "@lib/emitter";
const emitterSymbol = Symbol("emitter accessor"); const emitterSymbol = Symbol.for("vendetta.storage.emitter");
const syncAwaitSymbol = Symbol("wrapSync promise accessor"); const syncAwaitSymbol = Symbol.for("vendetta.storage.accessor");
export function createProxy(target: any = {}): { proxy: any; emitter: Emitter } { export function createProxy(target: any = {}): { proxy: any; emitter: Emitter } {
const emitter = createEmitter(); const emitter = createEmitter();