Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support for promises #46

Open
skwasjer opened this issue Sep 24, 2020 · 0 comments
Open

Support for promises #46

skwasjer opened this issue Sep 24, 2020 · 0 comments

Comments

@skwasjer
Copy link
Owner

skwasjer commented Sep 24, 2020

Support for promises would allow better integration with frameworks and coding styles that make use of promises.

Requirements

  • Don't break the current API
  • 0 (zero) callback handlers should be registered in both:
    • show(options)
    • show(options, successCallback, errorCallback)
      If this is the case, then we can return a promise from show(options)
  • promise resolve is same as options.success(date). options.cancel() should be supported also by resolving with undefined (no) argument. This behavioral difference must be well documented.
  • promise reject is same as options.error(err)
  • the implementation should be seamless and not break current behavior (when no promise support f.ex. is available or when callbacks are supplied).
  • the plugin will not include a polyfill for Promise, this is a choice the app developer can make for himself
  • ECMA5 compatibility

This is open for anyone to pick up. Improvements to these requirements welcome too.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant