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

Function mapOneMutably

modules/entity/src/sorted_state_adapter.ts:159–173  ·  view source on GitHub ↗
({ map, id }: any, state: any)

Source from the content-addressed store, hash-verified

157 function mapOneMutably(map: EntityMapOneNum<T>, state: R): DidMutate;
158 function mapOneMutably(map: EntityMapOneStr<T>, state: R): DidMutate;
159 function mapOneMutably({ map, id }: any, state: any): DidMutate {
160 const entity = state.entities[id];
161 if (!entity) {
162 return DidMutate.None;
163 }
164
165 const updatedEntity = map(entity);
166 return updateOneMutably(
167 {
168 id: id,
169 changes: updatedEntity,
170 },
171 state
172 );
173 }
174
175 function upsertOneMutably(entity: T, state: R): DidMutate;
176 function upsertOneMutably(entity: any, state: any): DidMutate {

Callers

nothing calls this directly

Calls 1

updateOneMutablyFunction · 0.70

Tested by

no test coverage detected