import { Selector, createSelector } from '@ngrx/store';
import { Company } from '@ucap-webmessenger/api-external';

export interface State {
  companyList: Company[] | null;
}

export const initialState: State = {
  companyList: null
};

export function selectors<S>(selector: Selector<any, State>) {
  return {
    companyList: createSelector(
      selector,
      (state: State) => state.companyList
    )
  };
}
