fix: providers
This commit is contained in:
parent
6b3fdb746c
commit
bc84502a7b
|
@ -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}));
|
||||
|
|
|
@ -5,7 +5,7 @@ export {default as LatusContext} from './context';
|
|||
export default {
|
||||
hooks: {
|
||||
'@latus/core/config': () => ({
|
||||
'client.providers': [],
|
||||
providers: [],
|
||||
entry: './react',
|
||||
}),
|
||||
},
|
||||
|
|
|
@ -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},
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue
Block a user