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

improv: update types #9

Closed
wants to merge 1 commit into from
Closed

improv: update types #9

wants to merge 1 commit into from

Conversation

Eywek
Copy link

@Eywek Eywek commented Dec 30, 2019

Use infer to retrieve function return type.

Example of use:

const analyze = async () => ({ status: 'OK' })
const [analyze, err] = await of<typeof analyze>(analyze())
if (err !== undefined) {
  // do what you want
}
console.log(analyze.status) // we have completion here

Use infer to retrieve function return type
@Eywek
Copy link
Author

Eywek commented Dec 30, 2019

I've checked for the PR Quality Review, found issues were already in the module before. I don't know if you me to fix it or not.

xobotyi added a commit that referenced this pull request Mar 4, 2020
Now only undefined rejection is treated as 'empty value' and replaced with Error instance.

Fixed types as requested in #9 & #15 not return type is inferred from promise.

BREAKING CHANGE: now module has default export only.
@xobotyi
Copy link
Owner

xobotyi commented Mar 4, 2020

TY for PR, but closing in favor of bf947c3

@xobotyi xobotyi closed this Mar 4, 2020
xobotyi pushed a commit that referenced this pull request Mar 4, 2020
# [2.0.0](v1.3.1...v2.0.0) (2020-03-04)

### Bug Fixes

* fix build; ([9ec99fa](9ec99fa))
* fix throw error in readme example; ([2eedd47](2eedd47))

### Features

* rework the module. ([bf947c3](bf947c3)), closes [#9](#9) [#15](#15)
* specify minimal node version as requested in [#7](#7) ([56e8fab](56e8fab))

### BREAKING CHANGES

* now module has default export only.
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