-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
base: next-minor
Are you sure you want to change the base?
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
d2ffdca
to
b9b3787
Compare
22c777d
to
7bf7bc5
Compare
f45852b
to
4fdcf95
Compare
Exports existing makeAbortSignal