useThrottledDailyEvent

useThrottledDailyEvent(params): void

Registers daily-js event listeners. The listeners are automatically torn down when a component or hook calling useThrottledDailyEvent gets unmounted. In comparison to useDailyEvent, the callback passed here will be called with an array of event objects.

Params

ParameterRequiredTypeDescription
eventstringThe daily-js event to register
callbackFunctionA memoized callback reference to run when the event is emittedlistener
throttleTimeoutintegerThe minimum waiting time until the callback is called again. Default: 100

The callback param has to be a memoized reference (e.g. via useCallback). Otherwise a console error might be thrown indicating a re-render loop.

Return type

  • void

Sample code