Service to handle actions when a person joins an event.
PersonJoined
Displays a notification when a person joins the event, using the showAlert function if provided.
showAlert
personJoined
Contains information about the person and alert display function:
name
Executes alert display through showAlert if defined.
const options = { name: 'Alice', showAlert: ({ message, type, duration }) => console.log(message)};personJoinedService.personJoined(options);// Logs: "Alice joined the event." Copy
const options = { name: 'Alice', showAlert: ({ message, type, duration }) => console.log(message)};personJoinedService.personJoined(options);// Logs: "Alice joined the event."
Handles the event when a person joins.
The options for the person joined event.
A promise that resolves when the alert has been shown.
Service to handle actions when a person joins an event.
Name
PersonJoined
Description
Displays a notification when a person joins the event, using the
showAlert
function if provided.Method
personJoined
Param: options
Contains information about the person and alert display function:
name
{string}: The name of the person who joined.showAlert
{Function} (optional): Function to display a notification when the person joins.Returns
Executes alert display through
showAlert
if defined.Example