http-react
Advanced tools
Comparing version 3.7.4 to 3.7.5
@@ -454,3 +454,3 @@ 'use client'; | ||
}); | ||
}, id: mockServerActionId }, config), { onResolve(...c) { | ||
}, id: mockServerActionId, auto: false }, config), { onResolve(...c) { | ||
if (config === null || config === void 0 ? void 0 : config.onResolve) | ||
@@ -457,0 +457,0 @@ config.onResolve(...c); |
@@ -38,2 +38,2 @@ declare const DEFAULTS: {}; | ||
}; | ||
export { DEFAULTS, QUERY, PARAMS, ON_OFFLINE, ON_ONLINE, ONLINE, ATTEMPTS, ATTEMPT_INTERVAL, REVALIDATE_ON_FOCUS, RETRY_ON_RECONNECT, REVALIDATE_ON_MOUNT, DEFAULT_GRAPHQL_PATH, DEFAULT_RESOLVER, METHODS, UNITS_MILISECONDS_EQUIVALENTS, DEFAULT_MIDDLEWARE, DEFAULT_TRANSFORM, }; | ||
export { DEFAULTS, QUERY, PARAMS, ON_OFFLINE, ON_ONLINE, ONLINE, ATTEMPTS, ATTEMPT_INTERVAL, REVALIDATE_ON_FOCUS, RETRY_ON_RECONNECT, REVALIDATE_ON_MOUNT, DEFAULT_GRAPHQL_PATH, DEFAULT_RESOLVER, METHODS, UNITS_MILISECONDS_EQUIVALENTS, DEFAULT_MIDDLEWARE, DEFAULT_TRANSFORM }; |
@@ -26,3 +26,3 @@ "use strict"; | ||
exports.REVALIDATE_ON_MOUNT = REVALIDATE_ON_MOUNT; | ||
const DEFAULT_GRAPHQL_PATH = "/graphql"; | ||
const DEFAULT_GRAPHQL_PATH = '/graphql'; | ||
exports.DEFAULT_GRAPHQL_PATH = DEFAULT_GRAPHQL_PATH; | ||
@@ -36,12 +36,12 @@ const DEFAULT_RESOLVER = (e) => e.json(); | ||
const METHODS = { | ||
GET: "GET", | ||
DELETE: "DELETE", | ||
HEAD: "HEAD", | ||
OPTIONS: "OPTIONS", | ||
POST: "POST", | ||
PUT: "PUT", | ||
PATCH: "PATCH", | ||
PURGE: "PURGE", | ||
LINK: "LINK", | ||
UNLINK: "UNLINK", | ||
GET: 'GET', | ||
DELETE: 'DELETE', | ||
HEAD: 'HEAD', | ||
OPTIONS: 'OPTIONS', | ||
POST: 'POST', | ||
PUT: 'PUT', | ||
PATCH: 'PATCH', | ||
PURGE: 'PURGE', | ||
LINK: 'LINK', | ||
UNLINK: 'UNLINK' | ||
}; | ||
@@ -57,4 +57,4 @@ exports.METHODS = METHODS; | ||
mo: 2629800000, | ||
y: 31536000000, | ||
y: 31536000000 | ||
}; | ||
exports.UNITS_MILISECONDS_EQUIVALENTS = UNITS_MILISECONDS_EQUIVALENTS; |
@@ -1,2 +0,2 @@ | ||
import { CacheStoreType, FetchContextType } from "../types"; | ||
import { CacheStoreType, FetchContextType } from '../types'; | ||
/** | ||
@@ -3,0 +3,0 @@ * This marks which requests are running |
@@ -1,2 +0,2 @@ | ||
"use client"; | ||
'use client'; | ||
"use strict"; | ||
@@ -86,3 +86,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.resolvedRequests.delete(k); | ||
}, | ||
} | ||
}; | ||
@@ -109,3 +109,3 @@ const requestsSubscribers = new Map(); | ||
} | ||
}, | ||
} | ||
}; | ||
@@ -112,0 +112,0 @@ const defaultContextVaue = Object.assign({ defaults: constants_1.DEFAULTS, attempts: constants_1.ATTEMPTS, attemptInterval: constants_1.ATTEMPT_INTERVAL, revalidateOnFocus: constants_1.REVALIDATE_ON_FOCUS, query: constants_1.QUERY, params: constants_1.PARAMS, onOffline: constants_1.ON_OFFLINE, onOnline: constants_1.ON_ONLINE, online: constants_1.ONLINE, retryOnReconnect: constants_1.RETRY_ON_RECONNECT, revalidateOnMount: constants_1.REVALIDATE_ON_MOUNT, cacheIfError: true, middleware: constants_1.DEFAULT_MIDDLEWARE, transform: constants_1.DEFAULT_TRANSFORM }, shared_1.$context.value); |
@@ -1,2 +0,2 @@ | ||
export type HTTP_METHODS = "GET" | "DELETE" | "HEAD" | "OPTIONS" | "POST" | "PUT" | "PATCH" | "PURGE" | "LINK" | "UNLINK"; | ||
export type HTTP_METHODS = 'GET' | 'DELETE' | 'HEAD' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH' | 'PURGE' | 'LINK' | 'UNLINK'; | ||
export type FetchContextType = { | ||
@@ -66,3 +66,3 @@ clientOnly?: boolean; | ||
maxCacheAge?: TimeSpan; | ||
} & Omit<RequestInit, "body">; | ||
} & Omit<RequestInit, 'body'>; | ||
export type CacheStoreType = { | ||
@@ -73,3 +73,3 @@ get(k?: any): any; | ||
}; | ||
export type CustomResponse<T> = Omit<Response, "json"> & { | ||
export type CustomResponse<T> = Omit<Response, 'json'> & { | ||
json(): Promise<T>; | ||
@@ -85,3 +85,3 @@ }; | ||
*/ | ||
reqConfig?: Omit<RequestInit & FetchConfigType<R, BodyType>, "suspense"> & { | ||
reqConfig?: Omit<RequestInit & FetchConfigType<R, BodyType>, 'suspense'> & { | ||
/** | ||
@@ -123,3 +123,3 @@ * Default value | ||
}>; | ||
export type TimeSpan = number | `${string} ${"ms" | "sec" | "min" | "h" | "d" | "we" | "mo" | "y"}`; | ||
export type TimeSpan = number | `${string} ${'ms' | 'sec' | 'min' | 'h' | 'd' | 'we' | 'mo' | 'y'}`; | ||
/** | ||
@@ -141,3 +141,3 @@ * An imperative version of the `useFetch` hook | ||
}; | ||
export type FetchConfigType<FetchDataType = any, BodyType = any> = Omit<RequestInit, "body" | "headers"> & { | ||
export type FetchConfigType<FetchDataType = any, BodyType = any> = Omit<RequestInit, 'body' | 'headers'> & { | ||
headers?: any; | ||
@@ -189,3 +189,3 @@ /** | ||
memory?: boolean; | ||
onSubmit?: "reset" | ((form: HTMLFormElement, data: FormData) => void); | ||
onSubmit?: 'reset' | ((form: HTMLFormElement, data: FormData) => void); | ||
/** | ||
@@ -305,7 +305,7 @@ * Function to run when request is resolved succesfuly | ||
*/ | ||
onFetchStart?: FetchContextType["onFetchStart"]; | ||
onFetchStart?: FetchContextType['onFetchStart']; | ||
/** | ||
* Will run when the response is received | ||
*/ | ||
onFetchEnd?: FetchContextType["onFetchEnd"]; | ||
onFetchEnd?: FetchContextType['onFetchEnd']; | ||
/** | ||
@@ -322,3 +322,3 @@ * If `true`, the last resolved value be returned as `data` if the request fails. If `false`, the default value will be returned instead | ||
}; | ||
export type FetchConfigTypeNoUrl<FetchDataType = any, BodyType = any> = Omit<FetchConfigType<FetchDataType, BodyType>, "url">; | ||
export type FetchConfigTypeNoUrl<FetchDataType = any, BodyType = any> = Omit<FetchConfigType<FetchDataType, BodyType>, 'url'>; | ||
/** | ||
@@ -325,0 +325,0 @@ * Create a configuration object to use in a 'useFetche' call |
{ | ||
"name": "http-react", | ||
"version": "3.7.4", | ||
"version": "3.7.5", | ||
"description": "React hooks for data fetching", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
235855
5473