Service for handling user waiting room actions, including notifications and updating request counts.
UserWaiting
Manages the logic when a user joins the waiting room by displaying alerts and incrementing the total request count.
userWaiting
The options for handling user waiting actions:
name
showAlert
totalReqWait
updateTotalReqWait
Resolves after alert is shown and request count is updated.
const options = { name: 'Alice', showAlert: ({ message, type, duration }) => console.log(message), totalReqWait: 3, updateTotalReqWait: (newTotal) => console.log(`Updated count: ${newTotal}`)};await userWaitingService.userWaiting(options); Copy
const options = { name: 'Alice', showAlert: ({ message, type, duration }) => console.log(message), totalReqWait: 3, updateTotalReqWait: (newTotal) => console.log(`Updated count: ${newTotal}`)};await userWaitingService.userWaiting(options);
Service for handling user waiting room actions, including notifications and updating request counts.
Name
UserWaiting
Description
Manages the logic when a user joins the waiting room by displaying alerts and incrementing the total request count.
Method
userWaiting
Async
Param: options
The options for handling user waiting actions:
name
{string}: Name of the user joining the waiting room.showAlert
{ShowAlert}: Optional function for showing an alert with a customizable message, type, and duration.totalReqWait
{number}: Current count of waiting requests.updateTotalReqWait
{Function}: Updates the total waiting request count.Returns
Resolves after alert is shown and request count is updated.
Example