Skip to content

Add using helper for JS disposable resources#1115

Open
joshamaju wants to merge 3 commits intothefrontside:v4from
joshamaju:using-helper-pr-v4
Open

Add using helper for JS disposable resources#1115
joshamaju wants to merge 3 commits intothefrontside:v4from
joshamaju:using-helper-pr-v4

Conversation

@joshamaju
Copy link
Contributor

Motivation

Add an Effection using helper so JavaScript Disposable and AsyncDisposable values can be scope-owned without requiring the native using keyword.

Approach

  • Add lib/using.ts with a using operation that binds disposal to scope teardown.
  • Validate disposers at runtime and fail fast for non-disposable values.
  • Export using from lib/mod.ts.
  • Add test/using.test.ts covering sync and async disposal, teardown on error and halt, async disposal completion, and invalid runtime input.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 15, 2026

Open in StackBlitz

npm i https://pkg.pr.new/thefrontside/effection@1115

commit: 75be7be

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.

1 participant