The Service

Akita recommends using a service rather than call the store methods directly by a component.

session.service.ts
import { SessionStore } from './session.store';
import { tap } from 'rxjs/operators';
export class SessionService {
constructor(private sessionStore: SessionStore,
private http: HttpClient) {}
login(creds) {
return http.login(creds).pipe(tap(user => {
this.sessionStore.update(user);
}));
}
}