fix: providers

This commit is contained in:
cha0s 2021-01-07 02:31:04 -06:00
parent 6b3fdb746c
commit bc84502a7b
6 changed files with 7 additions and 7 deletions

View File

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

View File

@ -5,7 +5,7 @@ export {default as LatusContext} from './context';
export default {
hooks: {
'@latus/core/config': () => ({
'client.providers': [],
providers: [],
entry: './react',
}),
},

View File

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

View File

@ -7,9 +7,9 @@ import configureStore from '../store';
export default {
hooks: {
'@latus/react/providers': async (latus) => {
'@latus/react/client/providers': async (latus) => {
const store = await configureStore(latus);
const slices = await gatherSlices();
const slices = await gatherSlices(latus);
const subscriptionReducers = Object.entries(slices).map(([key, slice]) => [
key,
slice.subscription || (() => null),

View File

@ -1,3 +1,3 @@
import {ensureUniqueReduction} from '@latus/core';
export default (latus) => ensureUniqueReduction(latus, '@latus/redux/slices');
export default (latus) => ensureUniqueReduction(latus, '@latus/redux/client/slices');

View File

@ -17,7 +17,7 @@ export default async function configureStore(latus) {
};
latus.invokeFlat('@latus/redux/store', options);
const {defaultState} = latus.config['@latus/redux/client'];
const slices = await gatherSlices();
const slices = await gatherSlices(latus);
const reducers = latus.invokeFlat('@latus/redux/reducers').concat(combineReducers(slices));
const reducer = reduceReducers({}, ...reducers);
return configureStoreR({