import { Injectable } from '@angular/core';

import { Actions, createEffect, ofType } from '@ngrx/effects';

import { Store } from '@ngrx/store';

import { NGXLogger } from 'ngx-logger';
import { userNotification } from './actions';
import { map, tap } from 'rxjs/operators';

@Injectable()
export class Effects {
  userNotification$ = createEffect(
    () => {
      return this.actions$.pipe(
        ofType(userNotification),
        map(action => action.noti),
        tap(noti => {})
      );
    },
    { dispatch: false }
  );

  constructor(
    private actions$: Actions,
    private store: Store<any>,
    private logger: NGXLogger
  ) {}
}
