0.2.2 #31

Merged
Thilawyn merged 184 commits from next into master 2026-01-16 17:05:31 +01:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit 94ba0b0c5e - Show all commits

View File

@@ -76,13 +76,14 @@ extends Pipeable.Class() implements Form<A, I, R, MA, ME, MR, MP> {
field<const P extends PropertyPath.Paths<I>>( field<const P extends PropertyPath.Paths<I>>(
path: P path: P
): Effect.Effect<FormField<PropertyPath.ValueFromPath<A, P>, PropertyPath.ValueFromPath<I, P>>> { ): Effect.Effect<FormField<PropertyPath.ValueFromPath<A, P>, PropertyPath.ValueFromPath<I, P>>> {
const key = new FormFieldKey(path)
return this.fieldCache.pipe( return this.fieldCache.pipe(
Effect.map(HashMap.get(new FormFieldKey(path))), Effect.map(HashMap.get(key)),
Effect.flatMap(Option.match({ Effect.flatMap(Option.match({
onSome: v => Effect.succeed(v as FormField<PropertyPath.ValueFromPath<A, P>, PropertyPath.ValueFromPath<I, P>>), onSome: v => Effect.succeed(v as FormField<PropertyPath.ValueFromPath<A, P>, PropertyPath.ValueFromPath<I, P>>),
onNone: () => Effect.tap( onNone: () => Effect.tap(
Effect.succeed(makeFormField(this as Form<A, I, R, MA, ME, MR, MP>, path)), Effect.succeed(makeFormField(this as Form<A, I, R, MA, ME, MR, MP>, path)),
v => Ref.update(this.fieldCache, HashMap.set(new FormFieldKey(path), v as FormField<unknown, unknown>)), v => Ref.update(this.fieldCache, HashMap.set(key, v as FormField<unknown, unknown>)),
), ),
})), })),
) )
@@ -259,7 +260,7 @@ class FormFieldKey implements Equal.Equal {
return isFormFieldKey(that) && PropertyPath.equivalence(this.path, that.path) return isFormFieldKey(that) && PropertyPath.equivalence(this.path, that.path)
} }
[Hash.symbol]() { [Hash.symbol]() {
return 0 return Hash.array(this.path)
} }
} }

View File

@@ -36,7 +36,7 @@ class QueryClientCacheKey implements Equal.Equal {
return isQueryClientKey(that) && Equivalence.array(Equal.equivalence())(this.key, that.key) return isQueryClientKey(that) && Equivalence.array(Equal.equivalence())(this.key, that.key)
} }
[Hash.symbol]() { [Hash.symbol]() {
return 0 return Hash.array(this.key)
} }
} }