import { Store } from 'angular-store';
// in some compoenent
constructor(private store: Store) {
this.store.dispatch({ type: 'username', payload: '@angular/store'});
}
// in reducer class
@Action('username') // this action will receive payload "@angular/store"
public onUsernameChange(payload: string, state: IState): void {
const newData = `${payload}_${new Date()}`;
const currentState = state.getState();
state.updateState({ key: username.key, payload: newData });
}