import { EntityState, EntityAdapter, createEntityAdapter } from '@ngrx/entity';

import { RPCClientError } from '@loafer/ng-rpc/protocol';

import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';

export interface State extends EntityState<NoAuthProbe> {
  error: RPCClientError | null;
  pending: boolean;
}

export const adapter: EntityAdapter<NoAuthProbe> = createEntityAdapter<NoAuthProbe>(); 

// export interface State {
//   error: RPCClientError | null;
//   pending: boolean;
//   noAuthProbes: NoAuthProbe[] | null;
// }

// export const initialState: State = {
//   error: null,
//   pending: false,
//   noAuthProbes: null,
// };

export const initialState: State = adapter.getInitialState({
  error: null,
  pending: false,
});
