Skip to content

Commit

Permalink
fixed: PromiseData - loading, success and error should be optional (#200
Browse files Browse the repository at this point in the history
)
  • Loading branch information
MakakWasTaken authored Oct 24, 2023
1 parent eb3a209 commit 732828a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ export type ToastTypes = 'normal' | 'action' | 'success' | 'info' | 'warning' |
export type PromiseT<Data = any> = Promise<Data> | (() => Promise<Data>);

export type PromiseData<ToastData = any> = ExternalToast & {
loading: string | React.ReactNode;
success: string | React.ReactNode | ((data: ToastData) => React.ReactNode | string);
error: string | React.ReactNode | ((error: any) => React.ReactNode | string);
loading?: string | React.ReactNode;
success?: string | React.ReactNode | ((data: ToastData) => React.ReactNode | string);
error?: string | React.ReactNode | ((error: any) => React.ReactNode | string);
finally?: () => void | Promise<void>;
};

Expand Down

0 comments on commit 732828a

Please sign in to comment.