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

Function addManyMutably

modules/entity/src/sorted_state_adapter.ts:31–42  ·  view source on GitHub ↗
(newModels: any[], state: any)

Source from the content-addressed store, hash-verified

29
30 function addManyMutably(newModels: T[], state: R): DidMutate;
31 function addManyMutably(newModels: any[], state: any): DidMutate {
32 const models = newModels.filter(
33 (model) => !(selectIdValue(model, selectId) in state.entities)
34 );
35
36 if (models.length === 0) {
37 return DidMutate.None;
38 } else {
39 merge(models, state);
40 return DidMutate.Both;
41 }
42 }
43
44 function setAllMutably(models: T[], state: R): DidMutate;
45 function setAllMutably(models: any[], state: any): DidMutate {

Callers 3

addOneMutablyFunction · 0.70
setAllMutablyFunction · 0.70
upsertManyMutablyFunction · 0.70

Calls 2

selectIdValueFunction · 0.90
mergeFunction · 0.85

Tested by

no test coverage detected