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

🎒backport advanced scope helpers from v4 -> v3 #980

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

cowboyd
Copy link
Member

@cowboyd cowboyd commented Mar 3, 2025

Motivation

In v4, the Scope interface got a little more powerful 💪💪

Specifically, it got an expect() helper to throw an error if a context is missing. It's the scope equivalent of Context.expect(). Also, there is a hasOwn() helper which is necessary for some cases where there needs to be a single context value per task.

Finally, there is delete() which is very rarely used, but rounds out the API, and since it's present in v4, it's probably a good idea to add it.

Approach

Bring the methods on over, along with some tests.

Verified

This commit was signed with the committer’s verified signature.
cowboyd Charles Lowell
In v4, the `Scope` interface got a little more powerful 💪💪

Specifically, it got an `expect()` helper to throw an error if a
context is missing. It's the scope equivalent of `Context.expect()`.
Also, there is a `hasOwn()` helper which is necessary for some cases
where there needs to be a single context value per task.

Finally, there is `delete()` which is very rarely used, but rounds out
the API, and since it's present in v4, it's probably a good idea to
add it.
@cowboyd cowboyd requested review from taras, jbolda, a team and neurosnap March 3, 2025 16:21
@cowboyd cowboyd merged commit 97c377a into v3 Mar 6, 2025
3 checks passed
@cowboyd cowboyd deleted the backport-scope-helpers-v3 branch March 6, 2025 15:09
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.

None yet

1 participant