Effect CommunityEC
Effect Community3mo ago
1 reply
janglad

Suggestion to make `Overrideable` fields key optional for `VariantSchema.Overrideable` in `Model`

Not sure if this is the right channel but posting here since it's used for Model: for VariantSchema.Overrideable, would it not make more sense for the Overrideable field to become key optional instead of just value optional? Leaving out the fields already works fine at runtime, but gives a type error. Providing them is unnecessarily verbose (unless I'm missing a usecase) and also leads to annoying situations when testing repositories with a partial match using

const payload: typeof MyModel.Update.type: {}
const updated = yield* ...
// will fail if Overridable fields are explicitly undefined in payload, which is needed for type checking
expect(updated).toMatchObject(payload)
Was this page helpful?