Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

chore(ts): add MaybePromise wrapper to make APIs shorter to read #333

Merged
merged 2 commits into from
Oct 12, 2020

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Oct 7, 2020

Summary

it's complex to type when an item is either a promise or not (and after #331 maybe arrays or not) from the typings, so refactoring this into a shared type makes sense

Result

add the complexity for types which are allowed to be promises or not into a single helper object

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 7, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit b577d33:

Sandbox Source
algolia/autocomplete.js: js Configuration

@Haroenv Haroenv merged commit b130b8e into next Oct 12, 2020
@Haroenv Haroenv deleted the chore/ts-promise-wrapper branch October 12, 2020 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants