Shallow merge meta with defaults #9785
Unanswered
backbone87
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When having default options with
meta
, themeta
object is completely replaced when "later" options also have ameta
key. This can be quite cumbersome when usingmeta
as a "DI container" , e.g.:I think it would be better if meta objects are automatically merged with default/common options. This might be a breaking change so i see 3 options how to do that:
meta
which receives the "default meta", e.g.{ meta: (meta: QueryMeta | undefined) => ({ ...meta, querySpecific: 'Foo' }) }
container
option that has merging behavior by default and otherwise behaves likemeta
(maybe deprecate meta)Beta Was this translation helpful? Give feedback.
All reactions