Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
wants to merge 1 commit into
base: v3
Choose a base branch
from

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.

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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant