rest-api-kit
Advanced tools
Comparing version 0.0.34 to 0.0.35
@@ -25,2 +25,6 @@ type MethodType = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; | ||
]; | ||
type TypedQueryHookReturnType<T> = [ | ||
(body?: T) => void, | ||
state: RequestStateType | ||
]; | ||
type StoreStateType = Record<string, any>; | ||
@@ -77,3 +81,3 @@ interface IOptions<R = any, T = any> { | ||
*/ | ||
declare function useRest<R = any, T = any>(url: string, paramsFromBase: IOptions<any, any>, options?: Partial<RestOptionsType>): QueryHookReturnType; | ||
declare function useRest<R = unknown, T = unknown>(url: string, paramsFromBase: IOptions<any, any>, options?: Partial<RestOptionsType>): TypedQueryHookReturnType<T>; | ||
@@ -80,0 +84,0 @@ declare const defaultOptions: IOptions<any, any>; |
@@ -293,3 +293,3 @@ "use strict"; | ||
} = useStore(); | ||
const trigger = async (body = {}) => { | ||
const trigger = async (body) => { | ||
try { | ||
@@ -419,3 +419,2 @@ const params = { ...paramsFromBase }; | ||
return { ...createCustomHooks(builtEndpoints) }; | ||
``; | ||
}; | ||
@@ -422,0 +421,0 @@ return { |
{ | ||
"name": "rest-api-kit", | ||
"version": "0.0.34", | ||
"version": "0.0.35", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.mjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
32854
923