-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Add Effect.makeAbortSignal #2547
Add Effect.makeAbortSignal #2547
Conversation
🦋 Changeset detectedLatest commit: 2d16dfc The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
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 |
e256d16
to
35db16d
Compare
packages/effect/src/Effect.ts
Outdated
* Creates an `AbortSignal` that is automatically aborted when the Scope is closed. | ||
* @since 3.1.0 | ||
*/ | ||
export const makeAbortSignalScoped: Effect<AbortSignal, never, Scope.Scope> = map( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm will think about it. There aren"t many cases where this is useful - usually the signals passed to tryPromise / async are all you need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically async and promise are enough. But there have been a few circumstances where I"ve needed a signal inside of an Effect.gen for example.
63909f4
to
78132c7
Compare
b31dc43
to
925a3f8
Compare
ed5a635
to
71323be
Compare
aacbb7a
to
2234d76
Compare
Considering this would no longer be used internally, I don"t think we need this addition. If you feel strongly about adding it, feel free to re-open to discuss. |
Exports existing makeAbortSignal