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

import { select, Store, Action } from '@ngrx/store';

import * as from<%= className %> from './<%= fileName %>.reducer';
import * as <%= className %>Selectors from './<%= fileName %>.selectors';

@Injectable()
export class <%= className %>Facade {

  loaded$ = this.store.pipe(select(<%= className %>Selectors.get<%= className %>Loaded));
  all<%= className %>$ = this.store.pipe(select(<%= className %>Selectors.getAll<%= className %>));
  selected<%= className %>$ = this.store.pipe(select(<%= className %>Selectors.getSelected));

  constructor(private store: Store<from<%= className %>.<%= className %>PartialState>) { }

  dispatch(action: Action) {
    this.store.dispatch(action);
  }
}
