Closed tavoyne closed 1 year ago
Latest commit: 1957162fae20e5a18ce7e45f1840a15edb23305d
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Currently, the shape of the
metadata
object can only be provided when calling theenv.*.getWithMetadata<Metadata>()
method, through the first (and only) type argument.Multiple call of this method =>
Metadata
has to be passed multiple times => not DRY.Most of the time, we know the shape of this object right where we define the
KVNamespace
type. I propose that we are able to passMetadata
toKVNamespace
as a the second type argument (afterK
), e.g.:This (micro) change is backward-compatible.