UNPKG

@amityco/ts-sdk-react-native

Version:

Amity Social Cloud Typescript SDK

21 lines (19 loc) 708 B
import { createCommunityMemberEventSubscriber } from './utils'; /** * ```js * import { onCommunityUserRoleAdded } from '@amityco/ts-sdk-react-native' * const dispose = onCommunityUserRoleAdded((community, member) => { * // ... * }) * ``` * * Fired when a role has been added to {@link Amity.CommunityUser} * * @param callback The function to call when the event was fired * @returns an {@link Amity.Unsubscriber} function to stop listening * * @category Community Events */ export const onCommunityUserRoleAdded = ( callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void, ) => createCommunityMemberEventSubscriber('community.roleAdded', callback);