-
Notifications
You must be signed in to change notification settings - Fork 88
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
Return ResultAsync<T, E> from safeTry instead of Promise<Result<T, E>> for better composability #562
Conversation
…> for better composability
🦋 Changeset detectedLatest commit: 16452c9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Appears to be a fix for #561 |
@mattpocock
not sure if I understand it fully |
@sharno Agree. Neverthrow doesn't guarantee that a function will never throw. So this feels overly defensive on the library's part. |
@sharno looks good, but note that types need to be updated on some tests |
updated and fixed the tests 👍 |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [neverthrow](https://github.com/supermacro/neverthrow) | dependencies | minor | [`7.0.1` -> `7.2.0`](https://renovatebot.com/diffs/npm/neverthrow/7.0.1/7.2.0) | --- ### Release Notes <details> <summary>supermacro/neverthrow (neverthrow)</summary> ### [`v7.2.0`](https://github.com/supermacro/neverthrow/blob/HEAD/CHANGELOG.md#720) [Compare Source](supermacro/neverthrow@v7.1.0...v7.2.0) ##### Minor Changes - [#​562](supermacro/neverthrow#562) [`547352f`](supermacro/neverthrow@547352f) Thanks [@​sharno](https://github.com/sharno)! - change the return type of `safeTry` to be `ResultAsync<T, E>` instead of `Promise<Result<T, E>>` for better composability ### [`v7.1.0`](https://github.com/supermacro/neverthrow/blob/HEAD/CHANGELOG.md#710) [Compare Source](supermacro/neverthrow@v7.0.1...v7.1.0) ##### Minor Changes - [#​467](supermacro/neverthrow#467) [`4b9d2fd`](supermacro/neverthrow@4b9d2fd) Thanks [@​untidy-hair ](https://github.com/untidy-hair)! - feat: add `andTee` and `andThrough` to handle side-effect ##### Patch Changes - [#​483](supermacro/neverthrow#483) [`96f7f66`](supermacro/neverthrow@96f7f66) Thanks [@​braxtonhall](https://github.com/braxtonhall)! - Fix `combineWithAllErrors` types - [#​563](supermacro/neverthrow#563) [`eadf50c`](supermacro/neverthrow@eadf50c) Thanks [@​mattpocock](https://github.com/mattpocock)! - Made err() infer strings narrowly for easier error tagging. </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41Ny4zIiwidXBkYXRlZEluVmVyIjoiMzguNzIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19--> Reviewed-on: https://git.tristess.app/alexandresoro/ouca/pulls/70 Reviewed-by: Alexandre Soro <[email protected]> Co-authored-by: renovate <[email protected]> Co-committed-by: renovate <[email protected]>
No description provided.