Skip to content

Commit

Permalink
fix: allow for resetting to undefined parts of the config of the NgRx…
Browse files Browse the repository at this point in the history
  • Loading branch information
Platonn authored Jan 7, 2025
1 parent 789b4bc commit ed738df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion projects/core/src/state/config/state-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export abstract class StateConfig {
/**
* A set of state keys that should be transferred from server.
*/
[key: string]: StateTransferType;
[key: string]: StateTransferType | undefined;
};
};
};
Expand Down
4 changes: 2 additions & 2 deletions projects/core/src/state/reducers/transfer-state.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function getTransferStateReducer(

export function getServerTransferStateReducer(
transferState: TransferState,
keys: { [key: string]: StateTransferType }
keys: { [key: string]: StateTransferType | undefined }
) {
const transferStateKeys = filterKeysByType(
keys,
Expand All @@ -63,7 +63,7 @@ export function getServerTransferStateReducer(

export function getBrowserTransferStateReducer(
transferState: TransferState,
keys: { [key: string]: StateTransferType },
keys: { [key: string]: StateTransferType | undefined },
isLoggedIn: boolean
) {
const transferStateKeys = filterKeysByType(
Expand Down
2 changes: 1 addition & 1 deletion projects/core/src/state/utils/get-state-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function getExclusionKeys(key: string, excludeKeys: string[]): string[] {
}

export function filterKeysByType(
keys: { [key: string]: StorageSyncType | StateTransferType },
keys: { [key: string]: StorageSyncType | StateTransferType | undefined },
type: StorageSyncType | StateTransferType
): string[] {
if (!keys) {
Expand Down

0 comments on commit ed738df

Please sign in to comment.