UNPKG

@rest-api/react-models

Version:

[![npm version](https://img.shields.io/npm/v/@rest-api/react-models)](https://www.npmjs.com/package/@rest-api/react-models) [![codecov](https://codecov.io/gh/hector7/rest-api-react-models/branch/master/graph/badge.svg)](https://codecov.io/gh/hector7/rest-

32 lines (31 loc) 986 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const ReducerStorage_1 = __importDefault(require("./ReducerStorage")); class Model { constructor(schema) { this.schema = schema; this._reducerName = ReducerStorage_1.default.getReducerName(); } /** @internal */ get name() { return this._reducerName; } } exports.default = Model; /* Not used... used in a newar future export class ComplexModel<S extends Schema<any, any, any>, Opts> extends Model<S>{ protected readonly opts: Schema<Opts, any, any> protected readonly getKey: (opts: Opts) => string constructor(schema: S, opts: Schema<Opts, any, any>, getKey: (optsItem: Opts) => string) { super(schema) this._reducerName = name this.getKey = getKey this.opts = opts } } */