Skip to content

Commit

Permalink
{} as Record<Id, T>
Browse files Browse the repository at this point in the history
  • Loading branch information
EskiMojo14 committed May 29, 2023
1 parent 75307e9 commit 6a11af6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/toolkit/src/entities/entity_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function getInitialEntityState<T, Id extends EntityId>(): EntityState<
> {
return {
ids: [],
entities: {},
entities: {} as Record<Id, T>,
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/entities/sorted_state_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function createSortedStateAdapter<T, Id extends EntityId>(
state: R
): void {
newEntities = ensureEntitiesArray(newEntities)
state.entities = {}
state.entities = {} as Record<Id, T>
state.ids = []

addManyMutably(newEntities, state)
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/entities/unsorted_state_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function createUnsortedStateAdapter<T, Id extends EntityId>(
newEntities = ensureEntitiesArray(newEntities)

state.ids = []
state.entities = {}
state.entities = {} as Record<Id, T>

addManyMutably(newEntities, state)
}
Expand Down

0 comments on commit 6a11af6

Please sign in to comment.