You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In https://github.com/slightlyoff/history_api/blob/master/history_and_modals.md the ModalCloseWatcher's primary interaction with the developer is firing either zero or one close events. It never fires multiple close events; once the close event has fired, the object doesn't do anything anymore; and the close event is purely informative, so nothing you do in response can affect the object.
This is the exact interaction pattern that Promises are better suited for. Could the close event instead become a .closed Promise attribute?
(The beforeclose proposed event should stay as it is; it can fire multiple times, you can preventDefault it, etc.)