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

realOrMocked

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

See Also

Presentation

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

Returns

RowProxyDelete & T -

the row from the store or the default object

Parameters

NameTypeDescription
entityState
EntityState<T>

the EntityState used to lookup the id

id
string

the id to lookup

defaultObject
T

the default object to return if the id doesn't exist

childDefinition
ChildDefinition<P, T>

the ChildDefinition of the child object that