Skip to content

ModalCloseWatcher should possibly use a promise rather than close event #34

@tabatkins

Description

@tabatkins

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions