react-transmit icon indicating copy to clipboard operation
react-transmit copied to clipboard

Allow user to configure which Promise implementation to use

Open XeeD opened this issue 11 years ago • 6 comments

Related to #26

@RickWong

Yes, I believe that should work. Although on second thought, we should expose this feature with a more explicit API:

import Bluebird from 'bluebird';
import Transmit from 'react-transmit';

Transmit.setPromiseLibrary(Bluebird);

XeeD avatar Jun 01 '15 10:06 XeeD

Not sure about the naming. usePromiseConstructor is more descriptive since Promise is not a library.

Transmit.setPromiseLibrary(Promise)     // odd
Transmit.usePromiseConstructor(Promise) // better, ihmo

ooflorent avatar Jun 01 '15 11:06 ooflorent

Valid concern. How's Transmit.setPromiseImplementation(Bluebird) ?

RickWong avatar Jun 01 '15 12:06 RickWong

I would like setPromiseConstructor most, but all mentioned names are fine with me.

XeeD avatar Jun 01 '15 14:06 XeeD

assume es6?

ericfong avatar Jun 01 '15 14:06 ericfong

@ericfong This is going to be optional. Assuming ES6 in global scope, but freedom to override within Transmit's scope.

RickWong avatar Jun 01 '15 15:06 RickWong

Implemented.

RickWong avatar Jun 01 '15 22:06 RickWong