Skip to content

Commit 4c9a227

Browse files
author
Raul de Heer
authored
Merge pull request #21 from franciscop/patch-1
Update TS types
2 parents 9aa8488 + 8c7a90b commit 4c9a227

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

index.js.flow

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
declare module 'use-async-effect' {
22
declare function useAsyncEffect(
3-
effect: (isMounted: () => boolean) => any | Promise<any>,
3+
effect: (isActive: () => boolean) => any | Promise<any>,
44
inputs?: any[]
55
): void;
66

77
declare function useAsyncEffect<V>(
8-
effect: (isMounted: () => boolean) => V | Promise<V>,
8+
effect: (isActive: () => boolean) => V | Promise<V>,
99
destroy?: ?(result?: V) => void,
1010
inputs?: any[]
1111
): void;

types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// TypeScript Version: 3.0
22
export function useAsyncEffect(
3-
effect: (isMounted: () => boolean) => unknown | Promise<unknown>,
3+
effect: (isActive: () => boolean) => unknown | Promise<unknown>,
44
inputs?: any[]
55
): void;
66

77
export function useAsyncEffect<V>(
8-
effect: (isMounted: () => boolean) => V | Promise<V>,
8+
effect: (isActive: () => boolean) => V | Promise<V>,
99
destroy?: (result?: V) => void,
1010
inputs?: any[]
1111
): void;

types/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import useEffect, { useAsyncEffect } from 'use-async-effect';
44
useAsyncEffect();
55

66
// $ExpectType void
7-
useAsyncEffect((isMounted) => {});
7+
useAsyncEffect((isActive) => {});
88

99
// $ExpectType void
1010
useEffect(async () => {});

0 commit comments

Comments
 (0)