How about using ES7 decorators, like so:
@idb_promise
function () {
//some code that uses the IDB API in Promise based way
}
and it would add .promise to the IDB APIs
On Mon, Sep 28, 2015 at 1:26 PM, David Rajchenbach-Teller <
dteller@mozilla.com> wrote:
> On 28/09/15 22:14, Marc Fawzi wrote:
> > <<
> > Instead of having .promise to appended to the IDB methods as
> > in `store.openCursor(query).promise` why couldn't you configure the IDB
> > API to be in Promise returning mode and in that case openCursor(query)
> > would return a Promise.
> >>>
> >
> > I meant user configurable, maybe as a global config.
>
> That sounds problematic. What if a codebase is modernized piecewise, and
> only some modules have been made Promise-friendly?
>
>
> --
> David Rajchenbach-Teller, PhD
> Performance Team, Mozilla
>
>