@amityco/ts-sdk-react-native
Version:
Amity Social Cloud Typescript SDK
21 lines (19 loc) • 725 B
text/typescript
import { createLocalCommunityMemberEventSubscriber } from './utils';
/**
* ```js
* import { onLocalCommunityUserAdded } from '@amityco/ts-sdk-react-native'
* const dispose = onLocalCommunityUserAdded((community, member) => {
* // ...
* })
* ```
*
* Fired when a user has been added to a {@link Amity.Community}
*
* @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 onLocalCommunityUserAdded = (
callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
) => createLocalCommunityMemberEventSubscriber('local.community.userAdded', callback);