Home
Using Smart NgRX
Demo Walkthrough
API
@smarttools/smart-ngrx / Function

getArrayItem

Generic types:T P

Internal function used by createInnerSmartSelector use to load the data if it doesn't exist in the store and return a placeholder row if it doesn't exist.

Presentation

function getArrayItem(
  entityState: EntityState<T>,
  id: string,
  childDefinition: ChildDefinition<P, T>,
): RowProxyDelete & T;

Returns

RowProxyDelete & T -

real or placeholder row

Parameters

NameTypeDescription
entityState
EntityState<T>

The EntityState to check for the id

id
string

The id to check

childDefinition
ChildDefinition<P, T>

The ChildDefinition of the child object