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

react-async-hook

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-async-hook - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

6

dist/index.d.ts

@@ -24,6 +24,6 @@ export declare type AsyncState<R> = {

};
export declare const useAsync: <R, Args extends any[]>(asyncFunction: (...args: Args) => Promise<R>, params: Args, options?: UseAsyncOptions<R>) => UseAsyncReturn<R, Args>;
export declare const useAsync: <R, Args extends any[]>(asyncFunction: ((...args: Args) => Promise<R>) | (() => Promise<R>), params: Args, options?: UseAsyncOptions<R>) => UseAsyncReturn<R, Args>;
declare type AddArg<H, T extends any[]> = ((h: H, ...t: T) => void) extends ((...r: infer R) => void) ? R : never;
export declare const useAsyncAbortable: <R, Args extends any[]>(asyncFunction: (...args: AddArg<AbortSignal, Args>) => Promise<R>, params: Args, options?: UseAsyncOptions<R>) => UseAsyncReturn<R, Args>;
export declare const useAsyncCallback: <R, Args extends any[]>(asyncFunction: (...args: Args) => MaybePromise<R>) => UseAsyncReturn<R, Args>;
export declare const useAsyncAbortable: <R, Args extends any[]>(asyncFunction: ((...args: AddArg<AbortSignal, Args>) => Promise<R>) | ((abortSignal: AbortSignal) => MaybePromise<R>), params: Args, options?: UseAsyncOptions<R>) => UseAsyncReturn<R, Args>;
export declare const useAsyncCallback: <R, Args extends any[]>(asyncFunction: ((...args: Args) => MaybePromise<R>) | (() => MaybePromise<R>)) => UseAsyncReturn<R, Args>;
export {};
{
"name": "react-async-hook",
"version": "3.1.0",
"version": "3.2.0",
"description": "Async hook",

@@ -5,0 +5,0 @@ "author": "Sébastien Lorber",

@@ -6,5 +6,6 @@ # React-async-hook

- Simplest way to get async result in your React component
- Very good, native, Typescript support
- Simplest way to get async result / feedback in your React component
- Works with any React platform (ReactNative, Expo...)
- Refetch on params change
- Handle async callbacks (mutations)
- Handle concurrency issues if params change too fast

@@ -15,3 +16,4 @@ - Flexible, works with any async function, not just api calls

- Options to customize state updates
- Handle async callbacks (mutations)
- Very good, native, Typescript support
- Small and no dependency

@@ -18,0 +20,0 @@ ## Usecase: loading async data into a component

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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