UNPKG

mediasfu-reactnative

Version:
28 lines 1.02 kB
/** * Handles the event when a person joins. * * @param {PersonJoinedOptions} options - The options for the person joined event. * @param {string} options.name - The name of the person who joined. * @param {Function} [options.showAlert] - Optional function to display an alert/notification. * @returns {Promise<void>} A promise that resolves when the alert has been shown. * * @example * ```typescript * const options = { * name: "Alice", * showAlert: ({ message, type, duration }) => console.log(message, type, duration), * }; * * await personJoined(options); * // Output: "Alice joined the event." (Displayed as a success alert for 3000 ms) * ``` */ export const personJoined = async ({ name, showAlert }) => { // Display an alert/notification about the person joining the event showAlert === null || showAlert === void 0 ? void 0 : showAlert({ message: `${name} joined the event.`, type: 'success', duration: 3000, }); }; //# sourceMappingURL=personJoined.js.map