Skip to content

Commit b45b480

Browse files
committed
Fix onReject handler in typings.
1 parent ce8d123 commit b45b480

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

typings/index.d.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface AsyncOptions<T> {
99
watch?: any
1010
initialValue?: T
1111
onResolve?: (data: T) => void
12-
onError?: (error: Error) => void
12+
onReject?: (error: Error) => void
1313
}
1414

1515
interface AsyncProps<T> extends AsyncOptions<T> {
@@ -33,10 +33,22 @@ interface AsyncState<T> {
3333
declare class Async<T> extends React.Component<AsyncProps<T>, AsyncState<T>> {}
3434

3535
declare namespace Async {
36-
export function Pending<T>(props: { children?: AsyncChildren<T>; persist?: boolean }): React.ReactNode
37-
export function Loading<T>(props: { children?: AsyncChildren<T>; initial?: boolean }): React.ReactNode
38-
export function Resolved<T>(props: { children?: AsyncChildren<T>; persist?: boolean }): React.ReactNode
39-
export function Rejected<T>(props: { children?: AsyncChildren<T>; persist?: boolean }): React.ReactNode
36+
export function Pending<T>(props: {
37+
children?: AsyncChildren<T>
38+
persist?: boolean
39+
}): React.ReactNode
40+
export function Loading<T>(props: {
41+
children?: AsyncChildren<T>
42+
initial?: boolean
43+
}): React.ReactNode
44+
export function Resolved<T>(props: {
45+
children?: AsyncChildren<T>
46+
persist?: boolean
47+
}): React.ReactNode
48+
export function Rejected<T>(props: {
49+
children?: AsyncChildren<T>
50+
persist?: boolean
51+
}): React.ReactNode
4052
}
4153

4254
declare function createInstance<T>(defaultProps?: AsyncProps<T>): Async<T>

0 commit comments

Comments
 (0)