feat(cookieJar): Change cookie.get to directly return value #10493
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
My original design of the
CookeiJar.get
would return the full cookie object we store, including cookie options. This is not ideal because you need to access the cookie like this:This is unwieldy, and feels unergonomic for the 98% of cases where
get
will be used to just see the value.How do I still see the options of the cookie?
You can still access all the details of the cookie by doing
cookie.entries
. I don't really have a case for this yet, so let's not optimise for this case, but we know it's possible!This is me just stabilizing the API for Middleware stuff, before we ship it out of experimental