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-

37 lines (36 loc) 1.25 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const ComplexIdActions_1 = __importDefault(require("./ComplexIdActions")); class BasicIdActions { constructor(model) { this.complexActions = new ComplexIdActions_1.default(model); } invalidateById(id) { return this.complexActions.invalidateById({}, id); } invalidateAll() { return this.complexActions.invalidateAll(); } fetchByIdIfNeeded(id, callback) { return this.complexActions.fetchByIdIfNeeded({}, id, callback); } fetchByIdPopulatedIfNeeded(id) { return this.complexActions.fetchByIdPopulatedIfNeeded({}, id); } post(item, callback) { return this.complexActions.post({}, item, callback); } put(id, item, callback) { return this.complexActions.put({}, id, item, callback); } patch(id, item, callback) { return this.complexActions.patch({}, id, item, callback); } delete(item, callback) { return this.complexActions.delete({}, item, callback); } } exports.default = BasicIdActions;