Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const createSnackbarQueue = (): {
messages: ArrayEmitter;
notify: (message: SnackbarQueueMessage) => void;
} => {
const messages = new ArrayEmitter();
return {
messages,
notify: (message: SnackbarQueueMessage) => {
messages.push(message);
}
};
};
export const createDialogQueue = (): {
dialogs: ArrayEmitter;
alert: (dialog: DialogQueueInput) => Promise;
confirm: (dialog: DialogQueueInput) => Promise;
prompt: (dialog: DialogQueueInput) => Promise;
} => {
const dialogs = new ArrayEmitter();
return {
dialogs,
alert: dialogFactory(alertFactory, dialogs),
confirm: dialogFactory(confirmFactory, dialogs),
prompt: dialogFactory(promptFactory, dialogs)
};
};