Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rest-hooks

Package Overview
Dependencies
Maintainers
1
Versions
328
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rest-hooks - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

2

lib/index.d.ts
import Resource, { SelectShape as ImportedSelectShape } from './resource/Resource';
import { RestProvider, hooks } from './react-rest';
import * as selectors from './state/selectors';
export declare type SelectShape<T extends typeof Resource, S> = ImportedSelectShape<T, S>;
export declare type SelectShape<Param extends object, Payload extends object | void> = ImportedSelectShape<Param, Payload>;
export { Resource, RestProvider, hooks, selectors };

@@ -6,2 +6,2 @@ import Resource from './resource/Resource';

export { Resource, RestProvider, hooks, selectors };
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6WyJSZXNvdXJjZSIsIlJlc3RQcm92aWRlciIsImhvb2tzIiwic2VsZWN0b3JzIl0sIm1hcHBpbmdzIjoiQUFBQSxPQUFPQSxRQUFQLE1BQTZELHFCQUE3RDtBQUNBLFNBQVNDLFlBQVQsRUFBdUJDLEtBQXZCLFFBQW9DLGNBQXBDO0FBQ0EsT0FBTyxLQUFLQyxTQUFaLE1BQTJCLG1CQUEzQixDLENBRUE7O0FBRUEsU0FBU0gsUUFBVCxFQUFtQkMsWUFBbkIsRUFBaUNDLEtBQWpDLEVBQXdDQyxTQUF4QyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZXNvdXJjZSwgeyBTZWxlY3RTaGFwZSBhcyBJbXBvcnRlZFNlbGVjdFNoYXBlIH0gZnJvbSAnLi9yZXNvdXJjZS9SZXNvdXJjZSc7XG5pbXBvcnQgeyBSZXN0UHJvdmlkZXIsIGhvb2tzIH0gZnJvbSAnLi9yZWFjdC1yZXN0JztcbmltcG9ydCAqIGFzIHNlbGV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c24ndCBwdXQgdGhlIGV4cG9ydCBpbiB0aGUgSlMgY29kZVxuZXhwb3J0IHR5cGUgU2VsZWN0U2hhcGU8XG4gIFBhcmFtIGV4dGVuZHMgb2JqZWN0LFxuICBQYXlsb2FkIGV4dGVuZHMgb2JqZWN0IHwgdm9pZFxuPiA9IEltcG9ydGVkU2VsZWN0U2hhcGU8UGFyYW0sIFBheWxvYWQ+O1xuZXhwb3J0IHsgUmVzb3VyY2UsIFJlc3RQcm92aWRlciwgaG9va3MsIHNlbGVjdG9ycyB9O1xuIl19
import React from 'react';
import Resource, { SelectShape } from '../resource/Resource';
import { SelectShape, ParamArg, PayloadArg } from '../resource/Resource';
export declare const StateContext: React.Context<{

@@ -9,3 +9,3 @@ entities: {};

export declare const DispatchContext: React.Context<{
fetch: <T extends typeof Resource, S>(selectDefinition: SelectShape<T, S>, params: object) => void | Promise<any>;
fetch: <S extends SelectShape<P1, P2>, P1 extends object, P2 extends void | object>(selectDefinition: S, params: ParamArg<S>, body: PayloadArg<S>) => void | Promise<any>;
}>;

@@ -8,4 +8,4 @@ import React from 'react';

export var DispatchContext = React.createContext({
fetch: function fetch(selectDefinition, params) {}
fetch: function fetch(selectDefinition, params, body) {}
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZWFjdC1yZXN0L2NvbnRleHQudHMiXSwibmFtZXMiOlsiUmVhY3QiLCJTdGF0ZUNvbnRleHQiLCJjcmVhdGVDb250ZXh0IiwiZW50aXRpZXMiLCJyZXN1bHRzIiwibWV0YSIsIkRpc3BhdGNoQ29udGV4dCIsImZldGNoIiwic2VsZWN0RGVmaW5pdGlvbiIsInBhcmFtcyJdLCJtYXBwaW5ncyI6IkFBQUEsT0FBT0EsS0FBUCxNQUFrQixPQUFsQjtBQUdBLE9BQU8sSUFBTUMsWUFBWSxHQUFHRCxLQUFLLENBQUNFLGFBQU4sQ0FBb0I7QUFBRUMsR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IGJvZHk6IFBheWxvYWRBcmc8Uz4sXG4gICk6IFByb21pc2U8YW55PiB8IHZvaWQgPT4ge30sXG59KTtcbiJdfQ==

@@ -1,6 +0,9 @@

import Resource, { SelectShape } from '../resource/Resource';
export declare function selectResource<T extends typeof Resource, S>({ select }: SelectShape<T, S>, params: {} | null): S | null;
export declare function fetchResource<T extends typeof Resource, S>(selectShape: SelectShape<T, S>, params: {} | null): void | Promise<any>;
declare type ResourceArgs<T extends typeof Resource, S> = [SelectShape<T, S>, {} | null];
export declare function useResource<T extends typeof Resource, S, A>(...args: ResourceArgs<T, S> | ResourceArgs<T, S>[]): A extends ResourceArgs<T, S>[] ? S[] : S;
export {};
import { SelectShape, SelectReturn, AlwaysSelect, ParamArg, PayloadArg } from '../resource/Resource';
export declare function selectResource<S extends SelectShape<P1, P2>, P1 extends object, P2 extends object>({ select }: S, params: ParamArg<S> | null): SelectReturn<S>;
export declare function fetchResource<S extends SelectShape<P1, P2>, P1 extends object, P2 extends object>(selectShape: S, params: ParamArg<S> | null, body?: PayloadArg<S>): void | Promise<any>;
export declare function useResource<S extends SelectShape<P1, P2>, P1 extends object, P2 extends object>(selectShape: S, params: ParamArg<S> | null): AlwaysSelect<S>;
export declare function useResource<S1 extends SelectShape<X, Y>, X extends object, Y extends object>(v1: [S1, ParamArg<S1> | null]): [AlwaysSelect<S1>];
export declare function useResource<S1 extends SelectShape<X1, Y1>, X1 extends object, Y1 extends object, S2 extends SelectShape<X2, Y2>, X2 extends object, Y2 extends object>(v1: [S1, ParamArg<S1> | null], v2: [S2, ParamArg<S2> | null]): [AlwaysSelect<S1>, AlwaysSelect<S2>];
export declare function useResource<S1 extends SelectShape<X1, Y1>, X1 extends object, Y1 extends object, S2 extends SelectShape<X2, Y2>, X2 extends object, Y2 extends object, S3 extends SelectShape<X3, Y3>, X3 extends object, Y3 extends object>(v1: [S1, ParamArg<S1> | null], v2: [S2, ParamArg<S2> | null], v3: [S3, ParamArg<S3> | null]): [AlwaysSelect<S1>, AlwaysSelect<S2>, AlwaysSelect<S3>];
export declare function useResource<S1 extends SelectShape<X1, Y1>, X1 extends object, Y1 extends object, S2 extends SelectShape<X2, Y2>, X2 extends object, Y2 extends object, S3 extends SelectShape<X3, Y3>, X3 extends object, Y3 extends object, S4 extends SelectShape<X4, Y4>, X4 extends object, Y4 extends object>(v1: [S1, ParamArg<S1> | null], v2: [S2, ParamArg<S2> | null], v3: [S3, ParamArg<S3> | null], v4: [S4, ParamArg<S4> | null]): [AlwaysSelect<S1>, AlwaysSelect<S2>, AlwaysSelect<S3>, AlwaysSelect<S4>];
export declare function useResource<S1 extends SelectShape<X1, Y1>, X1 extends object, Y1 extends object, S2 extends SelectShape<X2, Y2>, X2 extends object, Y2 extends object, S3 extends SelectShape<X3, Y3>, X3 extends object, Y3 extends object, S4 extends SelectShape<X4, Y4>, X4 extends object, Y4 extends object, S5 extends SelectShape<X5, Y5>, X5 extends object, Y5 extends object>(v1: [S1, ParamArg<S1> | null], v2: [S2, ParamArg<S2> | null], v3: [S3, ParamArg<S3> | null], v4: [S4, ParamArg<S4> | null], v5: [S5, ParamArg<S5> | null]): [AlwaysSelect<S1>, AlwaysSelect<S2>, AlwaysSelect<S3>, AlwaysSelect<S4>, AlwaysSelect<S5>];

@@ -6,2 +6,3 @@ import "core-js/modules/es6.array.from";

import "core-js/modules/es6.symbol";
import "core-js/modules/es6.array.is-array";
import "core-js/modules/es6.promise";

@@ -13,4 +14,11 @@ import "core-js/modules/web.dom.iterable";

import "core-js/modules/es6.array.filter";
import "core-js/modules/es6.array.is-array";
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }

@@ -24,10 +32,2 @@

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
import { useContext, useMemo } from 'react';

@@ -51,36 +51,19 @@ import { StateContext, DispatchContext } from './context';

export function fetchResource(selectShape, params) {
export function fetchResource(selectShape, params, body) {
var _useContext = useContext(DispatchContext),
fetch = _useContext.fetch;
if (!params) return;
if (!params) return; // TODO: figure out how to express that body is optional in SelectShape as we don't need to cast here
return useMemo(function () {
return fetch(selectShape, params);
return fetch(selectShape, params, body);
}, [params && selectShape.getUrl(params)]);
}
/*
const user = useResource(
UserResource.singleSelect(),
{ id },
);
*/
export function useResource() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (Array.isArray(args[0])) {
// TODO: provide type guard function to detect this
return useManyResources.apply(void 0, _toConsumableArray(args));
} // TODO: make return types match up with the branching logic we put in here.
return useOneResource(args[0], args[1]);
} // single form resource
// single form resource
function useOneResource(selectShape, params) {
var maybePromise = fetchResource(selectShape, params);
if (maybePromise && typeof maybePromise.then === 'function') throw maybePromise;
var resource = selectResource(selectShape, params); // fetch "guarantees" it will be in cache by this point
var resource = selectResource(selectShape, params);
if (!resource) throw Error("Resource not found when it should be ".concat(params)); // fetch "guarantees" it will be in cache by this point
// TODO: technically the data could be messed up even with an entry in the results table

@@ -93,4 +76,4 @@

function useManyResources() {
for (var _len2 = arguments.length, resourceList = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
resourceList[_key2] = arguments[_key2];
for (var _len = arguments.length, resourceList = new Array(_len), _key = 0; _key < _len; _key++) {
resourceList[_key] = arguments[_key];
}

@@ -121,4 +104,30 @@

/*
const user = useResource(
UserResource.singleSelect(),
{ id },
);
const [user, posts] = useResource(
[UserResource.singleSelect(), { id }],
[PostResource.listSelect(), { id: postid }]
);
*/
export function useResource() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (Array.isArray(args[0])) {
// TODO: provide type guard function to detect this
return useManyResources.apply(void 0, _toConsumableArray(args));
}
args = args; // TODO: make return types match up with the branching logic we put in here.
return useOneResource(args[0], args[1]);
}
/*
function UserForm() {
const { create } = useMutate(UserResource);
const create = useDispatch(UserResource.createSelect());
return <form onSubmit={(data) => create(data)}></form>

@@ -128,6 +137,6 @@ }

/*export function useMutate(model: Resource): MutateDispatchers {
/*export function useDispatch(selectShape: SelectShape<T, Body>) {
}
*/
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZWFjdC1yZXN0L2hvb2tzLnRzIl0sIm5hbWVzIjpbInVzZUNvbnRleHQiLCJ1c2VNZW1vIiwiU3RhdGVDb250ZXh0IiwiRGlzcGF0Y2hDb250ZXh0Iiwic2VsZWN0UmVzb3VyY2UiLCJwYXJhbXMiLCJzZWxlY3QiLCJzdGF0ZSIsInJlc291cmNlIiwiZmV0Y2hSZXNvdXJjZSIsInNlbGVjdFNoYXBlIiwiZmV0Y2giLCJnZXRVcmwiLCJ1c2VSZXNvdXJjZSIsImFyZ3MiLCJBcnJheSIsImlzQXJyYXkiLCJ1c2VNYW55UmVzb3VyY2VzIiwidXNlT25lUmVzb3VyY2UiLCJtYXliZVByb21pc2UiLCJ0aGVuIiwicmVzb3VyY2VMaXN0IiwicHJvbWlzZXMiL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XNlckZvcm0oKSB7XG4gIGNvbnN0IGNyZWF0ZSA9IHVzZURpc3BhdGNoKFVzZXJSZXNvdXJjZS5jcmVhdGVTZWxlY3QoKSk7XG4gIHJldHVybiA8Zm9ybSBvblN1Ym1pdD17KGRhdGEpID0+IGNyZWF0ZShkYXRhKX0+PC9mb3JtPlxufVxuKi9cbi8qZXhwb3J0IGZ1bmN0aW9uIHVzZURpc3BhdGNoKHNlbGVjdFNoYXBlOiBTZWxlY3RTaGFwZTxULCBCb2R5Pikge1xuXG59XG4qL1xuIl19

@@ -32,3 +32,6 @@ import "core-js/modules/es7.symbol.async-iterator";

window.requestIdleCallback(function () {
resolvers[action.meta.url](action.payload);
resolvers[action.meta.url](action.payload); // since we're resolved we no longer need to keep track of this promise
delete resolvers[action.meta.url];
delete fetched[action.meta.url];
}, {

@@ -52,3 +55,3 @@ timeout: 500

var dispatchers = {
fetch: useCallback(function (_ref2, params) {
fetch: useCallback(function (_ref2, params, body) {
var fetch = _ref2.fetch,

@@ -68,3 +71,3 @@ schema = _ref2.schema,

fetch('get', url).then(function (data) {
fetch(url, body).then(function (data) {
dispatch({

@@ -92,2 +95,2 @@ type: 'receive',

}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZWFjdC1yZXN0L3Byb3ZpZGVyLnRzeCJdLCJuYW1lcyI6WyJSZWFjdCIsInVzZVJlZHVjZXIiLCJ1c2VDYWxsYmFjayIsIlN0YXRlQ29udGV4dCIsIkRpc3BhdGNoQ29udGV4dCIsInJlZHVjZXIiLCJkZWZhdWx0U3RhdGUiLCJlbnRpdGllcyIsInJlc3VsdHMiLCJtZXRhIiwiZmV0Y2hlZCIsInJlc29sdmVycyIsIndyYXBwZWRSZWR1Y2VyIiwic3RhdGUiLCJhY3Rpb24iLCJ0eXBlIiwidXJsIiwid2luZG93IiwicmVxdWVzdElkbGVDYWxsYmFjayIsInBheWxvYWQiLCJ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amVjdCxcbiAgICAgICkgPT4ge1xuICAgICAgICBjb25zdCB1cmwgPSBnZXRVcmwocGFyYW1zKTtcbiAgICAgICAgLy8gd2UgYWxyZWFkeSBoYXZlIHRoZSByZXN1bHRzIGluIGNhY2hlLCBzbyBubyBuZWVkIHRvIGZldGNoIGFnYWluXG4gICAgICAgIGlmICh1cmwgaW4gc3RhdGUucmVzdWx0cykge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICAvLyB3ZSdyZSBhbHJlYWR5IGZldGNoaW5nIHNvIHJldXNlIHRoZSBwcm9taXNlXG4gICAgICAgIGlmICh1cmwgaW4gZmV0Y2hlZCkge1xuICAgICAgICAgIHJldHVybiBmZXRjaGVkW3VybF07XG4gICAgICAgIH1cbiAgICAgICAgZmV0Y2goJ2dldCcsIHVybCkudGhlbihkYXRhID0+IHtcbiAgICAgICAgICBkaXNwYXRjaCh7XG4gICAgICAgICAgICB0eXBlOiAncmVjZWl2ZScsXG4gICAgICAgICAgICBwYXlsb2FkOiBkYXRhLFxuICAgICAgICAgICAgbWV0YTogeyBzY2hlbWEsIHVybCB9LFxuICAgICAgICAgIH0pO1xuICAgICAgICAgIHJldHVybiBkYXRhO1xuICAgICAgICB9KTtcbiAgICAgICAgZmV0Y2hlZFt1cmxdID0gbmV3IFByb21pc2UocmVzb2x2ZSA9PiB7XG4gICAgICAgICAgcmVzb2x2ZXJzW3VybF0gPSByZXNvbHZlO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIGZldGNoZWRbdXJsXTtcbiAgICAgIH0sXG4gICAgICBbc3RhdGVdLFxuICAgICksXG4gIH07XG4gIHJldHVybiAoXG4gICAgPFN0YXRlQ29udGV4dC5Qcm92aWRlciB2YWx1ZT17c3RhdGV9PlxuICAgICAgPERpc3BhdGNoQ29udGV4dC5Qcm92aWRlciB2YWx1ZT17ZGlzcGF0Y2hlcnN9PlxuICAgICAgICB7Y2hpbGRyZW59XG4gICAgICA8L0Rpc3Bhd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oZSByZXN1bHRzIGluIGNhY2hlLCBzbyBubyBuZWVkIHRvIGZldGNoIGFnYWluXG4gICAgICAgIGlmICh1cmwgaW4gc3RhdGUucmVzdWx0cykge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICAvLyB3ZSdyZSBhbHJlYWR5IGZldGNoaW5nIHNvIHJldXNlIHRoZSBwcm9taXNlXG4gICAgICAgIGlmICh1cmwgaW4gZmV0Y2hlZCkge1xuICAgICAgICAgIHJldHVybiBmZXRjaGVkW3VybF07XG4gICAgICAgIH1cbiAgICAgICAgZmV0Y2godXJsLCBib2R5KS50aGVuKGRhdGEgPT4ge1xuICAgICAgICAgIGRpc3BhdGNoKHtcbiAgICAgICAgICAgIHR5cGU6ICdyZWNlaXZlJyxcbiAgICAgICAgICAgIHBheWxvYWQ6IGRhdGEsXG4gICAgICAgICAgICBtZXRhOiB7IHNjaGVtYSwgdXJsIH0sXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgcmV0dXJuIGRhdGE7XG4gICAgICAgIH0pO1xuICAgICAgICBmZXRjaGVkW3VybF0gPSBuZXcgUHJvbWlzZShyZXNvbHZlID0+IHtcbiAgICAgICAgICByZXNvbHZlcnNbdXJsXSA9IHJlc29sdmU7XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4gZmV0Y2hlZFt1cmxdO1xuICAgICAgfSxcbiAgICAgIFtzdGF0ZV0sXG4gICAgKSxcbiAgfTtcbiAgcmV0dXJuIChcbiAgICA8U3RhdGVDb250ZXh0LlByb3ZpZGVyIHZhbHVlPXtzdGF0ZX0+XG4gICAgICA8RGlzcGF0Y2hDb250ZXh0LlByb3ZpZGVyIHZhbHVlPXtkaXNwYXRjaGVyc30+XG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgIDwvRGlzcGF0Y2hDb250ZXh0LlByb3ZpZGVyPlxuICAgIDwvU3RhdGVDb250ZXh0LlByb3ZpZGVyPlxuICApO1xufVxuIl19
import request from 'superagent';
import { schema, Schema } from 'normalizr';
import { AbstractInstanceType, State, Method } from '../types';
import { AbstractInstanceType, State } from '../types';
export default abstract class Resource {

@@ -23,3 +23,3 @@ static readonly urlRoot: string;

getUrl(params: object): string;
fetch(method: "get" | "post" | "put" | "patch" | "delete" | undefined, url: string, body?: Partial<AbstractInstanceType<T>> | undefined): Promise<any>;
fetch(url: string, body?: object | undefined): Promise<any>;
};

@@ -30,10 +30,44 @@ static listSelect<T extends typeof Resource>(this: T): {

getUrl(params: object): string;
fetch(method: "get" | "post" | "put" | "patch" | "delete" | undefined, url: string, body?: Partial<AbstractInstanceType<T>> | undefined): Promise<any>;
fetch(url: string, body?: object | undefined): Promise<any>;
};
static createSelect<T extends typeof Resource>(this: T): {
select: (state: State<Resource>, urlParams: Partial<AbstractInstanceType<T>>) => AbstractInstanceType<T> | null;
schema: schema.Entity;
getUrl(): string;
fetch(url: string, body: Partial<AbstractInstanceType<T>>): Promise<any>;
};
static updateSelect<T extends typeof Resource>(this: T): {
select: (state: State<Resource>, urlParams: Partial<AbstractInstanceType<T>>) => AbstractInstanceType<T> | null;
schema: schema.Entity;
getUrl(params: object): string;
fetch(url: string, body: Partial<AbstractInstanceType<T>>): Promise<any>;
};
static partialUpdateSelect<T extends typeof Resource>(this: T): {
select: (state: State<Resource>, urlParams: Partial<AbstractInstanceType<T>>) => AbstractInstanceType<T> | null;
schema: schema.Entity;
getUrl(params: object): string;
fetch(url: string, body: Partial<AbstractInstanceType<T>>): Promise<any>;
};
static deleteSelect<T extends typeof Resource>(this: T): {
select: () => null;
schema: {};
getUrl(params: object): string;
fetch(url: string): Promise<any>;
};
}
export interface SelectShape<T extends typeof Resource, S extends any> {
select(state: State<Resource>, params: object): S;
getUrl(params: object): string;
export interface SelectShape<Param extends object, Payload extends object | void> {
select(state: State<Resource>, params: Param): any;
getUrl(params: Param): string;
schema: Schema;
fetch(method: Method, url: string, body?: Partial<AbstractInstanceType<T>>): Promise<any>;
fetch(url: string, body: Payload): Promise<any>;
}
export declare type SelectReturn<T> = T extends {
select: (...args: any[]) => infer U;
} ? U : never;
export declare type AlwaysSelect<T> = Exclude<SelectReturn<T>, null>;
export declare type ParamArg<T> = T extends {
select: (a: any, b: infer U) => any;
} ? U : never;
export declare type PayloadArg<T> = T extends {
fetch: (a: any, c: infer U) => any;
} ? U : never;

@@ -168,7 +168,4 @@ import "core-js/modules/es6.promise";

},
fetch: function fetch() {
var method = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'get';
var url = arguments.length > 1 ? arguments[1] : undefined;
var body = arguments.length > 2 ? arguments[2] : undefined;
return self.fetch(method, url, body);
fetch: function fetch(url, body) {
return self.fetch('get', url, body);
}

@@ -187,10 +184,70 @@ };

},
fetch: function fetch() {
var method = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'get';
var url = arguments.length > 1 ? arguments[1] : undefined;
var body = arguments.length > 2 ? arguments[2] : undefined;
return self.fetch(method, url, body);
fetch: function fetch(url, body) {
return self.fetch('get', url, body);
}
};
}
}, {
key: "createSelect",
value: function createSelect() {
var self = this;
return {
select: makeSingle(self),
schema: self.getSchema(),
getUrl: function getUrl() {
return self.listUrl();
},
fetch: function fetch(url, body) {
return self.fetch('post', url, body);
}
};
}
}, {
key: "updateSelect",
value: function updateSelect() {
var self = this;
return {
select: makeSingle(self),
schema: self.getSchema(),
getUrl: function getUrl(params) {
return self.url(params);
},
fetch: function fetch(url, body) {
return self.fetch('put', url, body);
}
};
}
}, {
key: "partialUpdateSelect",
value: function partialUpdateSelect() {
var self = this;
return {
select: makeSingle(self),
schema: self.getSchema(),
//TODO: change merge strategy in case we want to handle partial returns
getUrl: function getUrl(params) {
return self.url(params);
},
fetch: function fetch(url, body) {
return self.fetch('patch', url, body);
}
};
}
}, {
key: "deleteSelect",
value: function deleteSelect() {
var self = this;
return {
select: function select() {
return null;
},
schema: {},
getUrl: function getUrl(params) {
return self.url(params);
},
fetch: function fetch(url) {
return self.fetch('delete', url);
}
};
}
}]);

@@ -208,2 +265,2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GUgUGFyYW1Bcmc8VD4gPSBUIGV4dGVuZHMge1xuICBzZWxlY3Q6IChhOiBhbnksIGI6IGluZmVyIFUpID0+IGFueTtcbn1cbiAgPyBVXG4gIDogbmV2ZXI7XG5leHBvcnQgdHlwZSBQYXlsb2FkQXJnPFQ+ID0gVCBleHRlbmRzIHtcbiAgZmV0Y2g6IChhOiBhbnksIGM6IGluZmVyIFUpID0+IGFueTtcbn1cbiAgPyBVXG4gIDogbmV2ZXI7XG4iXX0=

@@ -24,9 +24,2 @@ import "core-js/modules/es6.array.for-each";

case 'fetch':
return _objectSpread({}, state, {
meta: _objectSpread({}, state.meta, _defineProperty({}, action.payload, _objectSpread({}, action.meta, {
status: 'fetching'
})))
});
default:

@@ -38,2 +31,2 @@ // A reducer must always return a valid state.

}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdGF0ZS9yZWR1Y2VyLnRzIl0sIm5hbWVzIjpbIm5vcm1hbGl6ZSIsInJlZHVjZXIiLCJzdGF0ZSIsImFjdGlvbiIsInR5cGUiLCJub3JtYWxpemVkIiwicGF5bG9hZCIsIm1ldGEiLCJzY2hlbWEiLCJlbnRpdGllcyIsInJlc3VsdHMiLCJ1cmwiLCJyZXN1bHQiLCJzdGF0dXMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztBQUFBLFNBQVNBLFNBQVQsUUFBMEIsV0FBMUI7QUFLQSxlQUFlLFNBQVNDLE9BQVQsQ0FBaUJDLEtBQWpCLEVBQXlDQyxNQUF6QyxFQUE4RDtBQUMzRSxVQUFRQSxNQUFNLENBQUNDLElBQWY7QUFDRSxTQUFLLFNBQUw7QUFDRSxVQUFNQyxVQUFVLEdBQUdMLFNBQVMsQ0FBQ0csTUFBTSxDQUFDRyxPQUFSLEVBQWlCSCxNQUFNLENBQUNJLElBQVAsQ0FBWUMsTUFBN0IsQ0FBNUI7QUFDQSxhQUFPO0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F0ZTxSZXNvdXJjZT4sIGFjdGlvbjogQWN0aW9uVHlwZXMpIHtcbiAgc3dpdGNoIChhY3Rpb24udHlwZSkge1xuICAgIGNhc2UgJ3JlY2VpdmUnOlxuICAgICAgY29uc3Qgbm9ybWFsaXplZCA9IG5vcm1hbGl6ZShhY3Rpb24ucGF5bG9hZCwgYWN0aW9uLm1ldGEuc2NoZW1hKTtcbiAgICAgIHJldHVybiB7XG4gICAgICAgIGVudGl0aWVzOiBtZXJnZSh7IC4uLnN0YXRlLmVudGl0aWVzIH0sIG5vcm1hbGl6ZWQuZW50aXRpZXMpLFxuICAgICAgICByZXN1bHRzOiB7XG4gICAgICAgICAgLi4uc3RhdGUucmVzdWx0cyxcbiAgICAgICAgICBbYWN0aW9uLm1ldGEudXJsXTogbm9ybWFsaXplZC5yZXN1bHQsXG4gICAgICAgIH0sXG4gICAgICAgIG1ldGE6IHN0YXRlLm1ldGEsXG4gICAgICB9O1xuICAgIGRlZmF1bHQ6XG4gICAgICAvLyBBIHJlZHVjZXIgbXVzdCBhbHdheXMgcmV0dXJuIGEgdmFsaWQgc3RhdGUuXG4gICAgICAvLyBBbHRlcm5hdGl2ZWx5IHlvdSBjYW4gdGhyb3cgYW4gZXJyb3IgaWYgYW4gaW52YWxpZCBhY3Rpb24gaXMgZGlzcGF0Y2hlZC5cbiAgICAgIHJldHVybiBzdGF0ZTtcbiAgfVxufVxuIl19
{
"name": "rest-hooks",
"version": "0.3.1",
"version": "0.4.0",
"description": "Easy react hooks for REST apis",

@@ -30,3 +30,5 @@ "sideEffects": false,

"networking",
"suspense"
"suspense",
"fetch",
"data fetching"
],

@@ -57,3 +59,3 @@ "author": "Nathaniel Tucker",

"devDependencies": {
"@anansi/babel-preset": "0.11.1",
"@anansi/babel-preset": "0.11.3",
"@anansi/eslint-config": "^0.5.2",

@@ -64,3 +66,3 @@ "@babel/cli": "^7.2.3",

"@types/lodash": "^4.14.120",
"@types/nock": "^9.3.0",
"@types/nock": "^9.3.1",
"@types/qs": "^6.5.1",

@@ -89,3 +91,3 @@ "babel-core": "^7.0.0-bridge.0",

"dependencies": {
"@types/react": "^16.7.20",
"@types/react": "^16.8.1",
"@types/superagent": "^3.8.6",

@@ -92,0 +94,0 @@ "core-js": "^2.6.3",

@@ -37,2 +37,2 @@ # Rest hooks: Data fetching and binding hooks

* Optimistic query update on create
* Cross-resource multi-update RPC
* Cross-resource multi-update RPC (dealing with side-effects)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc