Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 527 Bytes

hook.md

File metadata and controls

18 lines (12 loc) · 527 Bytes

useTracker

useTracker is a hook that provides the functions given in createTracker config. It also provides the function to get and set the context.

import { createTracker } from "@loggists/event-tracker";

const [_, useTracker] = createTracker({...})

const { setContext, getContext, events, send } = useTracker();

Return Value

  • setContext: (params: unknown) => void
  • getContext: () => unknown
  • events: Record<keyof EventNames, (params: unknown) => void>
  • send: (params: unknown) => void