Skip to content

Commit

Permalink
chore: fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
newsiberian committed Nov 25, 2021
1 parent 0fb05e6 commit 4c673c5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/hooks/useLoadGoogleCharts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export function useLoadGoogleCharts({

export interface ILoadGoogleChartsProps extends IUseLoadGoogleChartsParams {
onLoad?(googleCharts: GoogleViz): void;
onLoadCallback?(googleCharts: GoogleViz): void;
onError?(): void;
}

Expand All @@ -64,14 +65,20 @@ export interface ILoadGoogleChartsProps extends IUseLoadGoogleChartsParams {
*/
export function LoadGoogleCharts({
onLoad,
onLoadCallback,
onError,
...params
}: ILoadGoogleChartsProps) {
const [googleCharts, failed] = useLoadGoogleCharts(params);

useEffect(() => {
if (googleCharts && onLoad) {
onLoad(googleCharts);
if (googleCharts) {
if (onLoad) {
onLoad(googleCharts);
}
if (onLoadCallback) {
onLoadCallback(googleCharts);
}
}
}, [googleCharts]);

Expand Down

0 comments on commit 4c673c5

Please sign in to comment.