diff --git a/.changeset/thin-guests-exist.md b/.changeset/thin-guests-exist.md new file mode 100644 index 00000000..689d7e3b --- /dev/null +++ b/.changeset/thin-guests-exist.md @@ -0,0 +1,6 @@ +--- +"@reactive-dot/core": patch +"@reactive-dot/vue": patch +--- + +Added descriptive names to Symbols for better clarity. diff --git a/packages/core/src/providers/light-client/provider.ts b/packages/core/src/providers/light-client/provider.ts index d73ff179..a29e5c8d 100644 --- a/packages/core/src/providers/light-client/provider.ts +++ b/packages/core/src/providers/light-client/provider.ts @@ -11,7 +11,7 @@ import { getSmProvider } from "polkadot-api/sm-provider"; import { startFromWorker } from "polkadot-api/smoldot/from-worker"; import type { JsonRpcProvider } from "polkadot-api/ws-provider/web"; -const getProviderSymbol = Symbol(); +const getProviderSymbol = Symbol("getProvider"); export type LightClientProvider = { [getProviderSymbol]: () => Promise; diff --git a/packages/core/src/symbols.ts b/packages/core/src/symbols.ts index 14a87259..accc214c 100644 --- a/packages/core/src/symbols.ts +++ b/packages/core/src/symbols.ts @@ -1,3 +1,3 @@ -export const idle = Symbol(); +export const idle = Symbol("idle"); -export const pending = Symbol(); +export const pending = Symbol("pending"); diff --git a/packages/core/src/utils/lazy.ts b/packages/core/src/utils/lazy.ts index ca83eb6f..028dde41 100644 --- a/packages/core/src/utils/lazy.ts +++ b/packages/core/src/utils/lazy.ts @@ -1,4 +1,4 @@ -const empty = Symbol(); +const empty = Symbol("empty"); export function lazy(get: () => T) { let value: T | typeof empty = empty; diff --git a/packages/vue/src/keys.ts b/packages/vue/src/keys.ts index 39c8ef60..1374a0c5 100644 --- a/packages/vue/src/keys.ts +++ b/packages/vue/src/keys.ts @@ -3,24 +3,28 @@ import type { PolkadotSigner } from "@polkadot-api/polkadot-signer"; import type { ChainId, Config } from "@reactive-dot/core"; import type { InjectionKey, MaybeRefOrGetter, Ref, ShallowRef } from "vue"; -export const configKey = Symbol() as InjectionKey>; +export const configKey = Symbol("config") as InjectionKey< + MaybeRefOrGetter +>; -export const chainIdKey = Symbol() as InjectionKey>; +export const chainIdKey = Symbol("chainId") as InjectionKey< + MaybeRefOrGetter +>; -export const signerKey = Symbol() as InjectionKey< +export const signerKey = Symbol("signer") as InjectionKey< MaybeRefOrGetter >; /** * @internal */ -export const lazyValuesKey = Symbol() as InjectionKey< +export const lazyValuesKey = Symbol("lazyValues") as InjectionKey< MaybeRefOrGetter>> >; /** * @internal */ -export const mutationEventKey = Symbol() as InjectionKey< +export const mutationEventKey = Symbol("mutationEvent") as InjectionKey< Ref >;