Skip to content

Support for promises #46

@skwasjer

Description

@skwasjer

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions