♻️ Apply new code style to “common” store

This commit is contained in:
Philipp Stracker 2024-11-20 17:21:09 +01:00
parent 8f12e978f3
commit 7ae4184d30
No known key found for this signature in database
9 changed files with 130 additions and 109 deletions

View file

@ -2,7 +2,6 @@
* Reducer: Defines store structure and state updates for this module.
*
* Manages both transient (temporary) and persistent (saved) state.
* Each module uses isolated memory objects to prevent conflicts.
* The initial state must define all properties, as dynamic additions are not supported.
*
* @file
@ -16,6 +15,7 @@ import ACTION_TYPES from './action-types';
const defaultTransient = {
isReady: false,
isSaving: false,
isBusy: false,
};
const defaultPersistent = {
@ -38,6 +38,9 @@ const commonReducer = createReducer( defaultTransient, defaultPersistent, {
[ ACTION_TYPES.SET_PERSISTENT ]: ( state, action ) =>
setPersistent( state, action ),
[ ACTION_TYPES.HYDRATE ]: ( state, payload ) =>
setPersistent( state, payload.data ),
} );
export default commonReducer;