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

react-hooks-library

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hooks-library - npm Package Compare versions

Comparing version 0.0.34 to 0.0.35

6

dist/hooks/useQuery.d.ts

@@ -21,5 +21,9 @@ import { AxiosRequestConfig, AxiosResponse } from 'axios';

cancel: () => void;
refetch: (variable?: object | undefined) => Promise<void | [boolean, AxiosResponse<P>]>;
refetch: (variable?: object | undefined) => Promise<void | {
isSuccess: boolean;
response: AxiosResponse<P>;
data: P;
}>;
startPolling: (interval: number, variable?: object | undefined) => void;
stopPolling: () => void;
};

8

dist/hooks/useQuery.js

@@ -60,3 +60,3 @@ import * as tslib_1 from "tslib";

return tslib_1.__awaiter(_this, void 0, void 0, function () {
var query, queryResult, isSuccess, queryResponse, error_1;
var query, queryResult, isSuccess, queryResponse, queryData, error_1;
return tslib_1.__generator(this, function (_a) {

@@ -75,7 +75,7 @@ switch (_a.label) {

if (queryResult) {
isSuccess = queryResult[0], queryResponse = queryResult[1];
isSuccess = queryResult.isSuccess, queryResponse = queryResult.response, queryData = queryResult.data;
if (isSuccess) {
setData(queryResponse.data);
setData(queryData);
typeof props.onSuccess === 'function' &&
props.onSuccess(queryResponse.data, queryResponse);
props.onSuccess(queryData, queryResponse);
}

@@ -82,0 +82,0 @@ else {

import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
export declare type IHandleReponse<T> = (response: AxiosResponse<T>) => [boolean, AxiosResponse<T>];
export declare type IHandleReponse<T> = (response: AxiosResponse<T>) => {
isSuccess: boolean;
response: AxiosResponse<T>;
data: T;
};
export declare type IHandleError = (error: AxiosError) => void;

@@ -9,3 +13,7 @@ export declare const defaultsConfig: AxiosRequestConfig;

}) => void;
export declare const request: <T>(config: AxiosRequestConfig) => Promise<void | [boolean, AxiosResponse<T>]>;
export declare const request: <T>(config: AxiosRequestConfig) => Promise<void | {
isSuccess: boolean;
response: AxiosResponse<T>;
data: T;
}>;
export { axios };
var _this = this;
import * as tslib_1 from "tslib";
import axios from 'axios';
var handleResponse = function (response) { return [true, response]; };
var handleResponse = function (response) { return ({
isSuccess: true,
response: response,
data: response.data,
}); };
var handleError = function () { };

@@ -6,0 +10,0 @@ export var defaultsConfig = {

{
"name": "react-hooks-library",
"version": "0.0.34",
"version": "0.0.35",
"license": "MIT",

@@ -5,0 +5,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

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