Skip to main content

StoreFactory

Here you can find a list of the StoreFactory API and their usages:

OptionNameDescription
defaultStateinitial state
skipLogskip all Log Entries for the current created Store
storeNamename of the Store
pluginsdefine Plugins ( ClientStorePlugin)

createComponentStore

Create a new Store based on ngrx Component Store.

For more Information about ngrx-lite/component-store the read here

app.component.ts
export interface MyState {
counter: number;
}
export class AppComponent {
private store = this.storeFactory.createComponentStore<MyState>({
storeName: 'BASIC_COUNTER',
defaultState: { counter: 0 },
});
constructor(private storeFactory: StoreFactory) {}
}

createComponentLoadingStore

Create a LoadingStore based on ngrx Component Store.

For more Information about component-store from ngrx-lite the read the component-store For more Information about ngrx-lite/loading-store the read here

app.component.ts
export interface MyState {
counter: number;
}
export class AppComponent {
private store = this.storeFactory.createComponentStore<MyState>({
storeName: 'BASIC_COUNTER',
defaultState: { counter: 0 },
});
constructor(private storeFactory: StoreFactory) {}
}