Store Config

name: The name of the store. The name is a required parameter and must be unique for the entire application.

session.store.ts
@StoreConfig({ name: 'session' })
export class SessionStore extends Store<Session> {
constructor() {
super(initialState);
}
}
@StoreConfig({ name: 'brandMetric' })
export class BrandMetricStore extends Store<BrandMetric> {
constructor() {
super(initialState);
}
}

idKey: see entity Id section.

@StoreConfig({ name: 'cart', idKey: '_id' })
export class CartStore extends EntityStore<CartState, CartItem> {
constructor() {
super();
}
}

resettable - whether to allow a reset() functionality. This means that you will be able to call store.reset() any time to go back to the store's initial state value. (false by default)

@StoreConfig({ name: 'cart', resettable: true })
export class CartStore extends EntityStore<CartState, CartItem> {
constructor() {
super();
}
}

cache - see cache functionality section.

deepFreezeFn - a custom deep freeze function.

function customDeepFreeze(state) {
// usefull for working with moment objects, for example
// ...
return freezedState;
}
@StoreConfig({ name: 'cart', deepFreezeFn: customDeepFreeze })
export class CartStore extends EntityStore<CartState, CartItem> {
constructor() {
super();
}
}