All files / src/app/core/facades message.facade.ts

44.44% Statements 4/9
75% Branches 3/4
0% Functions 0/5
44.44% Lines 4/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 3349x 49x   49x                   49x                                      
import { Injectable } from '@angular/core';
import { Store } from '@ngrx/store';
 
import {
  MessagesPayloadType,
  displayErrorMessage,
  displayInfoMessage,
  displaySuccessMessage,
  displayWarningMessage,
} from 'ish-core/store/core/messages';
 
// not-dead-code
@Injectable({ providedIn: 'root' })
export class MessageFacade {
  constructor(private store: Store) {}
 
  info(data: MessagesPayloadType) {
    this.store.dispatch(displayInfoMessage(data));
  }
 
  error(data: MessagesPayloadType) {
    this.store.dispatch(displayErrorMessage(data));
  }
 
  warn(data: MessagesPayloadType) {
    this.store.dispatch(displayWarningMessage(data));
  }
 
  success(data: MessagesPayloadType) {
    this.store.dispatch(displaySuccessMessage(data));
  }
}