Skip to content

Commit

Permalink
Merge pull request #26 from TheRakeshPurohit/patch-2
Browse files Browse the repository at this point in the history
callback type added
  • Loading branch information
koblas committed Dec 8, 2021
2 parents 40ad102 + a7bdb49 commit 842424a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Amplitude.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ type Props = {
userProperties?: object;
};

export type Callback = (responseCode: number, responseBody: string, details?: { reason: string }) => void;

export function useAmplitude(eventProperties: object = {}, instanceName: string = "$default_instance") {
const { amplitudeInstance, eventProperties: inheritedProperties } = useAmplitudeContext();

return React.useMemo(() => {
function logEvent<T extends string>(
eventType: T,
eventPropertiesIn: object = {},
callback?: any
callback?: Callback
) {
if (!amplitudeInstance) {
return;
Expand Down

0 comments on commit 842424a

Please sign in to comment.