import { RPCClientError } from '@loafer/ng-rpc/protocol';
import { Sensor } from '@overflow/commons-typescript/model/sensor';
import { createEntityAdapter, EntityAdapter, EntityState } from '@ngrx/entity';

export interface State extends EntityState<Sensor> {
  error: RPCClientError | null;
  isPending: boolean;
  sensor: Sensor | null;
}
export const adapter: EntityAdapter<Sensor> = createEntityAdapter<Sensor>();
export const initialState: State = adapter.getInitialState({
  error: null,
  isPending: false,
  sensor: null,
});
