UNPKG

@amityco/ts-sdk-react-native

Version:

Amity Social Cloud Typescript SDK

30 lines (28 loc) 817 B
import { getActiveClient } from '~/client/api'; import { createEventSubscriber } from '~/core/events'; /** * ```js * import { onLiveReactionCreatedLocal } from '@amityco/ts-sdk' * const dispose = onLiveReactionCreatedLocal(reactions => { * // ... * }) * ``` * * Fired when a batch of {@link Amity.LiveReaction} has been created * * @param callback The function to call when the event was fired * @returns an {@link Amity.Unsubscriber} function to stop listening * * @category Live Reaction Events */ export const onLiveReactionCreatedLocal = ( callback: Amity.Listener<Amity.LiveReaction[]>, ): Amity.Unsubscriber => { const client = getActiveClient(); return createEventSubscriber( client, 'live_reaction/onLiveReactionCreated', 'local.liveReaction.created', callback, ); };