await-to-js icon indicating copy to clipboard operation
await-to-js copied to clipboard

fix: add readonly to promise type for flexibility

Open nicholaschiang opened this issue 4 years ago • 1 comments
trafficstars

When using this library with algoliasearch (whose return types are always Readonly<Promise<T>>), I've had to use a wrapper function so that I can update those types.

This allows for more flexibility (i.e. by reducing the required properties on the Promise object) and for use with more restrictive libraries like algoliasearch.

nicholaschiang avatar Mar 01 '21 19:03 nicholaschiang

@scopsy I'd love to get this merged and released as soon as you've got time! Awesome work on this library by the way. I never knew that such a small piece of code could be so useful.

nicholaschiang avatar Mar 01 '21 19:03 nicholaschiang