import { Query } from '@datorama/akita';
import { pipe } from 'fp-ts/lib/function';
import * as O from 'fp-ts/Option';
import benefitsAppStore from './benefits-app.store';
export class BenefitsAppQuery extends Query {
  constructor(store) {
    super(store);
    this.store = store;
    this.signedInUser$ = this.select((state) => state.user);
    this.signedInUserRole$ = this.select((state) => pipe(state.user, O.fold(() => 'user', (v) => v.benefitsProfile.role)));
  }
}
export default new BenefitsAppQuery(benefitsAppStore);
