asab_webui_components 26.1.3 → 26.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -87,11 +87,9 @@ function AppStoreProvider(_ref) {
|
|
|
87
87
|
children,
|
|
88
88
|
app
|
|
89
89
|
} = _ref;
|
|
90
|
-
// Keep the initial state from the registry at mount
|
|
91
|
-
var initialState = (0, _reducerRegistry.getInitialStates)();
|
|
92
90
|
// Pulls the current reducer set on every action:
|
|
93
91
|
var reducerFn = (0, _react.useCallback)((state, action) => combineReducers((0, _reducerRegistry.getReducers)())(state, action), []);
|
|
94
|
-
var [state, dispatch] = (0, _react.useReducer)(reducerFn,
|
|
92
|
+
var [state, dispatch] = (0, _react.useReducer)(reducerFn, app.AppStore.state);
|
|
95
93
|
|
|
96
94
|
// Wrapped dispatch to update both React state and global AppStore.state
|
|
97
95
|
var wrappedDispatch = action => {
|
|
@@ -78,12 +78,10 @@ const AppStoreContext = createContext();
|
|
|
78
78
|
|
|
79
79
|
// App store
|
|
80
80
|
export function AppStoreProvider({ children, app }) {
|
|
81
|
-
// Keep the initial state from the registry at mount
|
|
82
|
-
const initialState = getInitialStates();
|
|
83
81
|
// Pulls the current reducer set on every action:
|
|
84
82
|
const reducerFn = useCallback((state, action) => combineReducers(getReducers())(state, action), []);
|
|
85
83
|
|
|
86
|
-
const [state, dispatch] = useReducer(reducerFn,
|
|
84
|
+
const [state, dispatch] = useReducer(reducerFn, app.AppStore.state);
|
|
87
85
|
|
|
88
86
|
// Wrapped dispatch to update both React state and global AppStore.state
|
|
89
87
|
const wrappedDispatch = (action) => {
|