@rest-api/react-models
Version:
[](https://www.npmjs.com/package/@rest-api/react-models) [](https://codecov.io/gh/hector7/rest-
16 lines (15 loc) • 1.01 kB
TypeScript
import { Schema, StringOrNumberKeys } from '../models/Schema';
import { RestModel } from '../models/restmodels';
import { ReducerType } from '../models/ReducerStorage';
export default class ComplexIdReducer<Opts, S extends Schema<any>, IdKey extends StringOrNumberKeys<S['RealType']> & StringOrNumberKeys<S['PopulatedType']> & string> {
private restModel;
constructor(restModel: RestModel<Opts, S, IdKey>);
private getReducer;
getById(state: ReducerType, id: S['RealType'][IdKey]): S['RealType'] | null;
getByIdPopulated(state: ReducerType, id: S['RealType'][IdKey]): S['PopulatedType'] | null;
getIdError(state: ReducerType, id: S['RealType'][IdKey]): import("../..").HttpError | null;
isIdPopulated(state: ReducerType, id: S['RealType'][IdKey]): boolean;
isIdInitialized(state: ReducerType, id: S['RealType'][IdKey]): boolean;
isIdFetching(state: ReducerType, id: S['RealType'][IdKey]): boolean;
isIdInvalidated(state: ReducerType, id: S['RealType'][IdKey]): boolean;
}