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

Function selectIdValue

modules/entity/src/utils.ts:4–19  ·  view source on GitHub ↗
(entity: T, selectId: IdSelector<T>)

Source from the content-addressed store, hash-verified

2import { IdSelector } from './models';
3
4export function selectIdValue<T>(entity: T, selectId: IdSelector<T>) {
5 const key = selectId(entity);
6
7 if (isDevMode() && key === undefined) {
8 console.warn(
9 '@ngrx/entity: The entity passed to the `selectId` implementation returned undefined.',
10 'You should probably provide your own `selectId` implementation.',
11 'The entity that was passed:',
12 entity,
13 'The `selectId` implementation:',
14 selectId.toString()
15 );
16 }
17
18 return key;
19}

Callers 10

addOneMutablyFunction · 0.90
setOneMutablyFunction · 0.90
takeNewKeyFunction · 0.90
upsertManyMutablyFunction · 0.90
addManyMutablyFunction · 0.90
setOneMutablyFunction · 0.90
takeUpdatedModelFunction · 0.90
upsertManyMutablyFunction · 0.90
mergeFunction · 0.90
utils.spec.tsFile · 0.90

Calls 2

warnMethod · 0.80
selectIdFunction · 0.50

Tested by

no test coverage detected