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

LoadByIds

Manages the loading of rows by their Ids

Constructor

The constructor for the LoadByIds class.

Presentation
constructor(
	private feature: string, 
	private entity: string, 
	private store: Store<object>
): LoadByIds;
Parameters
NameTypeDescription
feature
string

the name of the feature this class is for

entity
string

the name of the entity this class is for

store
Store<object>

the store to dispatch the actions to

Methods

init()

Initializes the service with the actions and starts the dispatcher.

Presentation
init(actions: ActionGroup<SmartNgRXRowBase>, entities: Observable<Dictionary<SmartNgRXRowBase>>, defaultRow: (id: string) => SmartNgRXRowBase): void;
Parameters
NameTypeDescription
actions
ActionGroup<SmartNgRXRowBase>

the actions to use

entities
Observable<Dictionary<SmartNgRXRowBase>>

the entities to check for loading

defaultRow
(id: string) => SmartNgRXRowBase

the default row to use

Returns
void

loadByIds()

Calls the loadByIds action to load the rows into the store.

Presentation
loadByIds(ids: string[]): void;
Parameters
NameTypeDescription
ids
string[]

the ids to load

Returns
void

loadByIdsDispatcher()

Dispatches the loadByIds action after buffering the ids.

Presentation
loadByIdsDispatcher(): void;
Returns
void

loadByIdsPreload()

Calls the loadByIdsPreload action to load the rows into the store.

Presentation
loadByIdsPreload(ids: string[]): void;
Parameters
NameTypeDescription
ids
string[]

the ids to load

Returns
void

loadByIdsSuccess()

puts the rows in the store

Presentation
loadByIdsSuccess(rows: SmartNgRXRowBase[]): void;
Parameters
NameTypeDescription
rows
SmartNgRXRowBase[]

the rows to put in the store

Returns
void