MCPcopy Create free account
hub / github.com/ngrx/platform / takeUpdatedModel

Function takeUpdatedModel

modules/entity/src/sorted_state_adapter.ts:90–104  ·  view source on GitHub ↗
(models: any[], update: any, state: any)

Source from the content-addressed store, hash-verified

88
89 function takeUpdatedModel(models: T[], update: Update<T>, state: R): boolean;
90 function takeUpdatedModel(models: any[], update: any, state: any): boolean {
91 if (!(update.id in state.entities)) {
92 return false;
93 }
94
95 const original = state.entities[update.id];
96 const updated = Object.assign({}, original, update.changes);
97 const newKey = selectIdValue(updated, selectId);
98
99 delete state.entities[update.id];
100
101 models.push(updated);
102
103 return newKey !== update.id;
104 }
105
106 function updateManyMutably(updates: Update<T>[], state: R): DidMutate;
107 function updateManyMutably(updates: any[], state: any): DidMutate {

Callers 1

updateManyMutablyFunction · 0.85

Calls 1

selectIdValueFunction · 0.90

Tested by

no test coverage detected