childrenEntitiesSelector
childrenEntitiesSelector
is a function which creates a predefined relationship selector factory.
Its goal is to simply the process of creating relationship selectors with childrenEntities
.
declare function childrenEntitiesSelector(
selector,
keyId,
keyValue,
);
Its parameters are the same as childrenEntities
has, but without relationships.
const company = rootEntitySelector(
selectCompanyState,
);
const companyStaff = childrenEntitiesSelector(
selectUserState,
'companyId',
'staff',
);
// later.
const company1 = company(
selectUserState(),
);
// the same as.
const company2 = rootEntity(
selectCompanyState,
childrenEntities(
selectUserState,
'companyId',
'staff',
),
);