Skip to content

Commit f883279

Browse files
committed
some self-review
1 parent ee3c55d commit f883279

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
"devDependencies": {
4141
"@antfu/eslint-config": "latest",
4242
"@rocicorp/resolver": "1.0.2",
43-
"@testing-library/vue": "^8.1.0",
4443
"@vitest/coverage-v8": "latest",
4544
"bumpp": "latest",
4645
"changelogithub": "13.16.0",

src/create-zero.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { shallowRef, toValue, watch } from 'vue'
55

66
export const zeroSymbol = Symbol('zero') as InjectionKey<ShallowRef<Zero<Schema, undefined>>>
77

8-
const oldZeroCleanups = new Set()
8+
const zeroCleanups = new Set()
99

1010
export function createZero<S extends Schema = Schema, MD extends CustomMutatorDefs | undefined = undefined>(optsOrZero: MaybeRefOrGetter<ZeroOptions<S, MD> | { zero: Zero<S, MD> }>) {
1111
const z = shallowRef() as ShallowRef<Zero<S, MD>>
@@ -15,17 +15,17 @@ export function createZero<S extends Schema = Schema, MD extends CustomMutatorDe
1515

1616
watch(() => toValue(optsOrZero), (opts) => {
1717
const cleanupZeroPromise = z.value.close()
18-
oldZeroCleanups.add(cleanupZeroPromise)
18+
zeroCleanups.add(cleanupZeroPromise)
1919
cleanupZeroPromise.finally(() => {
20-
oldZeroCleanups.delete(cleanupZeroPromise)
20+
zeroCleanups.delete(cleanupZeroPromise)
2121
})
2222

2323
z.value = 'zero' in opts ? opts.zero : new Zero(opts)
2424
}, { deep: true })
2525

2626
return {
2727
install: (app: App) => {
28-
// @ts-expect-error - TODO: type properly
28+
// @ts-expect-error - The type of z doesn't line up with the type of zeroSymbol.
2929
app.provide(zeroSymbol, z)
3030
},
3131
}

0 commit comments

Comments
 (0)