diff --git a/packages/rx/src/Rx.ts b/packages/rx/src/Rx.ts index 8677db4..a45b0ab 100644 --- a/packages/rx/src/Rx.ts +++ b/packages/rx/src/Rx.ts @@ -1026,23 +1026,23 @@ export const family = typeof WeakRef === "undefined" || typeof FinalizationRegis ( f: (arg: Arg) => T ): (arg: Arg) => T => { - let atoms = MutableHashMap.empty() + const atoms = MutableHashMap.empty() return function(arg) { const atomEntry = MutableHashMap.get(atoms, arg) if (atomEntry._tag === "Some") { return atomEntry.value } const newAtom = f(arg) - atoms = MutableHashMap.set(atoms, arg, newAtom) + MutableHashMap.set(atoms, arg, newAtom) return newAtom } } : ( f: (arg: Arg) => T ): (arg: Arg) => T => { - let atoms = MutableHashMap.empty>() + const atoms = MutableHashMap.empty>() const registry = new FinalizationRegistry((arg) => { - atoms = MutableHashMap.remove(atoms, arg) + MutableHashMap.remove(atoms, arg) }) return function(arg) { const atomEntry = MutableHashMap.get(atoms, arg).pipe( @@ -1053,7 +1053,7 @@ export const family = typeof WeakRef === "undefined" || typeof FinalizationRegis return atomEntry.value } const newAtom = f(arg) - atoms = MutableHashMap.set(atoms, arg, new WeakRef(newAtom)) + MutableHashMap.set(atoms, arg, new WeakRef(newAtom)) registry.register(newAtom, arg) return newAtom }