lit/lit
View on GitHub[labs/context] Allow multiple provider contexts to be added at the same time
Open
#3,573 opened on Jan 17, 2023
Good First Issue
Description
Should this be an RFC?
- This is not a substantial change
Which package is this a feature request for?
Context (@lit-labs/context)
Description
It would be useful to be able to provide multiple contexts at the same time; allowing a provider component to be instantiated the same way but with a dynamic array of contexts
private provider = new MultiContextProvider(this, [
[loggerContext, {
log: (msg) => {
console.log(`[my-app] ${msg}`);
},
}],
[themeContext, myTheme],
[apiContext, myAPI],
]);
Alternatives and Workarounds
It's possible to create a separate provider for every injected service.