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

Add Effect.makeAbortSignal #2547

Open
wants to merge 5 commits into
base: next-minor
Choose a base branch
from

Conversation

jessekelly881
Copy link
Contributor

@jessekelly881 jessekelly881 commented Apr 17, 2024

Exports existing makeAbortSignal

Copy link

changeset-bot bot commented Apr 17, 2024

🦋 Changeset detected

Latest commit: 2d16dfc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
effect Minor
@effect/cli Major
@effect/experimental Major
@effect/opentelemetry Major
@effect/platform-browser Major
@effect/platform-bun Major
@effect/platform-node-shared Major
@effect/platform-node Major
@effect/platform Major
@effect/printer-ansi Major
@effect/printer Major
@effect/rpc-http Major
@effect/rpc Major
@effect/schema Major
@effect/sql-mssql Major
@effect/sql-mysql2 Major
@effect/sql-pg Major
@effect/sql-sqlite-bun Major
@effect/sql-sqlite-node Major
@effect/sql-sqlite-react-native Major
@effect/sql-sqlite-wasm Major
@effect/sql Major
@effect/typeclass Major
@effect/vitest Major

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

@jessekelly881 jessekelly881 changed the base branch from main to next-minor April 17, 2024 02:43
@jessekelly881 jessekelly881 force-pushed the Effect-makeAbortSignal branch 2 times, most recently from e256d16 to 35db16d Compare April 17, 2024 02:59
packages/effect/src/Effect.ts Outdated Show resolved Hide resolved
* 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(
Copy link
Member

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.

Copy link
Contributor Author

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.

@github-actions github-actions bot force-pushed the next-minor branch 2 times, most recently from 63909f4 to 78132c7 Compare April 17, 2024 12:52
@jessekelly881 jessekelly881 changed the title Add Effect.makeAbortSignal(Scoped) Add Effect.makeAbortSignal Apr 17, 2024
@github-actions github-actions bot force-pushed the next-minor branch 15 times, most recently from b31dc43 to 925a3f8 Compare April 18, 2024 23:05
@github-actions github-actions bot force-pushed the next-minor branch 18 times, most recently from d2ffdca to b9b3787 Compare June 1, 2024 16:25
@tim-smart tim-smart force-pushed the next-minor branch 2 times, most recently from 22c777d to 7bf7bc5 Compare June 5, 2024 23:51
@github-actions github-actions bot force-pushed the next-minor branch 10 times, most recently from f45852b to 4fdcf95 Compare June 7, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Discussion Ongoing
Development

Successfully merging this pull request may close these issues.

None yet

2 participants