Opens an overlay and returns a promise for its acceptance.
It's useful to think of overlays as promises that can either be fulfilled (accepted) or rejected (dismissed).
Instead of using up.layer.open() and passing callbacks, you can use up.layer.ask().
up.layer.ask() returns a promise for the acceptance value, which you can await:
let user = await up.layer.ask({ url: '/users/new' })
console.log("New user is " + user)
To handle the case where the overlay wasn't completed successfully, you
can catch the rejected promise reason:
try {
let user = await up.layer.ask({ url: '/users/new' })
console.log("New user is", user)
} catch (reason) {
console.error("Could not register:", reason)
}
A promise that settles when the overlay closes.
When the overlay is accepted, the promise will fulfill with the overlay's acceptance value.
When the overlay is dismissed, the promise will reject with the overlay's dismissal reason.