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, themetaobject is completely replaced when "later" options also have ametakey. This can be quite cumbersome when usingmetaas 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:
metawhich receives the "default meta", e.g.{ meta: (meta: QueryMeta | undefined) => ({ ...meta, querySpecific: 'Foo' }) }containeroption that has merging behavior by default and otherwise behaves likemeta(maybe deprecate meta)Beta Was this translation helpful? Give feedback.
All reactions