diff options
Diffstat (limited to 'compose.js')
-rw-r--r-- | compose.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compose.js b/compose.js new file mode 100644 index 0000000..b520983 --- /dev/null +++ b/compose.js @@ -0,0 +1,10 @@ +import { createElement } from 'react'; + +const Compose = ({ providers = [], children }) => { + if (providers.length < 0) { + return children; + } + return providers.reduce((acc, cur) => createElement(cur, [], acc), children); +} + +export default Compose;
\ No newline at end of file |