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.16 to 0.0.17

dist/hooks/useCancellablePromise.d.ts

4

dist/hooks/useQuery.js

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

import { usePrevious } from './usePrevious';
import { useCancellablePromise } from './useCancellablePromise';
export function useQuery(props) {

@@ -14,2 +15,3 @@ var _this = this;

var _a = useState(mergedProps.initialData), data = _a[0], setData = _a[1];
var cancellablePromise = useCancellablePromise().cancellablePromise;
var _b = useState(undefined), error = _b[0], setError = _b[1];

@@ -49,3 +51,3 @@ var _c = useState(false), loading = _c[0], setLoading = _c[1];

_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, mergedProps.query(variable)];
return [4 /*yield*/, cancellablePromise(mergedProps.query(variable))];
case 2:

@@ -52,0 +54,0 @@ response = _a.sent();

{
"name": "react-hooks-library",
"version": "0.0.16",
"version": "0.0.17",
"license": "MIT",

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

@@ -5,2 +5,3 @@ import { useState, useEffect } from 'react'

import { usePrevious } from './usePrevious'
import { useCancellablePromise } from './useCancellablePromise'

@@ -28,2 +29,3 @@ export interface IQueryProps<P> {

)
const { cancellablePromise } = useCancellablePromise()
const [error, setError] = useState<any>(undefined)

@@ -60,3 +62,3 @@ const [loading, setLoading] = useState(false)

try {
const response = await mergedProps.query(variable)
const response = await cancellablePromise(mergedProps.query(variable))

@@ -63,0 +65,0 @@ if (response) {

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