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 {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.

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);

Constructors

Methods

Constructors

Methods