refactor: react providers

This commit is contained in:
cha0s 2021-01-19 11:38:18 -06:00
parent 89446a5d4e
commit b2f84fde52
3 changed files with 3 additions and 4 deletions

View File

@ -17,7 +17,7 @@ export default {
.map(async ([key, Component]) => [key, await Component]), .map(async ([key, Component]) => [key, await Component]),
), ),
); );
const Providers = await latus.invokeOrdered('@latus/react/client/providers'); const Providers = await latus.invokeOrdered('@latus/react/providers');
const RootComponent = () => { const RootComponent = () => {
const children = Object.entries(Components) const children = Object.entries(Components)
.map(([key, Component]) => React.createElement(Component, {key})); .map(([key, Component]) => React.createElement(Component, {key}));

View File

@ -56,10 +56,9 @@ export default {
client.use.push(middleware); client.use.push(middleware);
}, },
'@latus/http/plugins': (req, { '@latus/http/plugins': (req, {
config: {'@latus/react': {providers, entry}}, config: {'@latus/react': {entry}},
}) => ({ }) => ({
[entry]: {}, [entry]: {},
'@latus/react/client': {providers},
}), }),
}, },
}; };

View File

@ -5,7 +5,7 @@ import {storageSubscription} from './storage';
export default { export default {
hooks: { hooks: {
'@latus/react/client/providers': async (latus) => { '@latus/react/providers': async (latus) => {
const slices = latus.get('%slices'); const slices = latus.get('%slices');
const store = latus.get('%store'); const store = latus.get('%store');
const subscriptionReducers = Object.entries(slices).map(([key, slice]) => [ const subscriptionReducers = Object.entries(slices).map(([key, slice]) => [