Skip to content

readAllFrom()

Function

readAllFrom<S, EntityType>(queryEntity: QueryEntity<S, getEntityType<S>, getIDType<S>>): Read<EntityType[]>

Create a new Read containing an array of all entities in the used QueryEntity:

ts
const entities$: Read<EntityState[]> = readAllFrom(queryEntity);

Source: akita-read/src/lib/read-all-from.ts:28

Type parameters

ParameterDefaultDescription
S extends EntityState<any, any>-entity stated used by the queryEntity
EntityTypegetEntityType<S>-

Parameters

ParameterTypeDescription
queryEntityQueryEntity<S, getEntityType<S>, getIDType<S>>QueryEntity to select from

Returns

Read<EntityType[]>

Returns a new Read that emits an array containing all entities in the QueryEntity.

readAllFrom<S, EntityType>(queryEntity: QueryEntity<S, getEntityType<S>, getIDType<S>>, options: SelectAllOptionsA<EntityType>): Read<HashMap<EntityType>>

Create a new Read containing an object with all entities in the used QueryEntity:

ts
const entities$: Read<EntityState[]> = readAllFrom(queryEntity, {asObject: true});

Source: akita-read/src/lib/read-all-from.ts:44

Type parameters

ParameterDefaultDescription
S extends EntityState<any, any>-entity stated used by the queryEntity
EntityTypegetEntityType<S>-

Parameters

ParameterTypeDescription
queryEntityQueryEntity<S, getEntityType<S>, getIDType<S>>QueryEntity to select from
optionsSelectAllOptionsA<EntityType>options on how to select the entities.
Check Akita-Documentation for more infos.

Returns

Read<HashMap<EntityType>>

Returns a new Read that emits an object with all entities in the QueryEntity.

readAllFrom<S, EntityType>(queryEntity: QueryEntity<S, getEntityType<S>, getIDType<S>>, options: SelectAllOptionsB<EntityType>): Read<EntityType[]>

Create a new Read containing an array of all entities in the used QueryEntity after applying the filter:

ts
const entities$: Read<EntityState[]> = readAllFrom(queryEntity, {filterBy: (entity) => entity.done});

Source: akita-read/src/lib/read-all-from.ts:64

Type parameters

ParameterDefaultDescription
S extends EntityState<any, any>-entity stated used by the queryEntity
EntityTypegetEntityType<S>-

Parameters

ParameterTypeDescription
queryEntityQueryEntity<S, getEntityType<S>, getIDType<S>>QueryEntity to select from
optionsSelectAllOptionsB<EntityType>options on how to select the entities.
Check Akita-Documentation for more infos.

Returns

Read<EntityType[]>

Returns a new Read that emits an array of all entities in the QueryEntity passing the filter function.

readAllFrom<S, EntityType>(queryEntity: QueryEntity<S, getEntityType<S>, getIDType<S>>, options: SelectAllOptionsC<EntityType>): Read<HashMap<EntityType>>

Create a new Read containing an object with all entities in the used QueryEntity:

ts
const entities$: Read<EntityState[]> = readAllFrom(queryEntity, {asObject: true});

Source: akita-read/src/lib/read-all-from.ts:83

Type parameters

ParameterDefaultDescription
S extends EntityState<any, any>-entity stated used by the queryEntity
EntityTypegetEntityType<S>-

Parameters

ParameterTypeDescription
queryEntityQueryEntity<S, getEntityType<S>, getIDType<S>>QueryEntity to select from
optionsSelectAllOptionsC<EntityType>options on how to select the entities.
Check Akita-Documentation for more infos.

Returns

Read<HashMap<EntityType>>

Returns a new Read that emits an object with all entities in the QueryEntity.

readAllFrom<S, EntityType>(queryEntity: QueryEntity<S, getEntityType<S>, getIDType<S>>, options: SelectAllOptionsD<EntityType>): Read<EntityType[]>

Create a new Read containing an array of all entities in the used QueryEntity limiting the count to the limit provided:

ts
const entities$: Read<EntityState[]> = readAllFrom(queryEntity, {limitTo: 5});

Source: akita-read/src/lib/read-all-from.ts:103

Type parameters

ParameterDefaultDescription
S extends EntityState<any, any>-entity stated used by the queryEntity
EntityTypegetEntityType<S>-

Parameters

ParameterTypeDescription
queryEntityQueryEntity<S, getEntityType<S>, getIDType<S>>QueryEntity to select from
optionsSelectAllOptionsD<EntityType>options on how to select the entities.
Check Akita-Documentation for more infos.

Returns

Read<EntityType[]>

Returns a new Read that emits an array of all entities in the QueryEntity up to the limit.

readAllFrom<S, EntityType>(queryEntity: QueryEntity<S, getEntityType<S>, getIDType<S>>, options: SelectAllOptionsE<EntityType>): Read<EntityType[]>

Create a new Read containing an array of all entities in the used QueryEntity sorted by the key:

ts
const entities$: Read<EntityState[]> = readAllFrom(queryEntity, {sortBy: 'price', sortByOrder: Order.ASC});

Source: akita-read/src/lib/read-all-from.ts:123

Type parameters

ParameterDefaultDescription
S extends EntityState<any, any>-entity stated used by the queryEntity
EntityTypegetEntityType<S>-

Parameters

ParameterTypeDescription
queryEntityQueryEntity<S, getEntityType<S>, getIDType<S>>QueryEntity to select from
optionsSelectAllOptionsE<EntityType>options on how to select the entities.
Check Akita-Documentation for more infos.

Returns

Read<EntityType[]>

Returns a new Read that emits an array of all entities in the QueryEntity ordered according to the passed options.