cookies().get() is an asynchronous function. Adding await to the sample code ensures that the cookie is read prior to moving to the next instructions. Not handling this as a promise makes it prone for the code to not run as intended and hard to debug.
What does this PR do?
cookies().get()
is an asynchronous function. Addingawait
to the sample code ensures that the cookie is read prior to moving to the next instructions. Not handling this as a promise makes it prone for the code to not run as intended and hard to debug.Test Plan
Not needed, sample code just follows the standards https://wicg.github.io/cookie-store/#CookieStore-get
Related PRs and Issues
Fixes #1364
Have you read the Contributing Guidelines on issues?
Yes