@saneksa/react-context-composer
Version:
[](https://npmjs.com/package/@saneksa/react-context-composer/) [](http
11 lines (8 loc) • 383 B
JavaScript
import { jsx, Fragment } from 'react/jsx-runtime';
function composeContexts(wrappers) {
return function (children) { return (jsx(Fragment, { children: wrappers.reduceRight(function (acc, _a) {
var Context = _a[0], value = _a[1];
return (jsx(Context.Provider, { value: value, children: acc }));
}, children) })); };
}
export { composeContexts };