All files / src/app/extensions/contact-us/facades contact-us.facade.ts

36.36% Statements 4/11
75% Branches 3/4
0% Functions 0/4
36.36% Lines 4/11

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 272x 2x       2x       2x                                  
import { Injectable } from '@angular/core';
import { Store, select } from '@ngrx/store';
 
import { Contact } from 'ish-core/models/contact/contact.model';
 
import { createContact, getContactLoading, getContactSubjects, getContactSuccess, loadContact } from '../store/contact';
 
/* eslint-disable @typescript-eslint/member-ordering */
@Injectable({ providedIn: 'root' })
export class ContactUsFacade {
  constructor(private store: Store) {}
 
  contactSubjects$() {
    this.store.dispatch(loadContact());
    return this.store.pipe(select(getContactSubjects));
  }
  contactLoading$ = this.store.pipe(select(getContactLoading));
  contactSuccess$ = this.store.pipe(select(getContactSuccess));
 
  resetContactState() {
    this.store.dispatch(loadContact());
  }
  createContact(contact: Contact) {
    this.store.dispatch(createContact({ contact }));
  }
}