(entity: T, selectId: IdSelector<T>)
| 2 | import { IdSelector } from './models'; |
| 3 | |
| 4 | export 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 | } |
no test coverage detected