Comparing version 2.0.0-next-03ba92 to 2.0.0-next-084233
@@ -7,3 +7,3 @@ # context - Changelog | ||
## 2.0.0 - 2021-11-20 | ||
## 2.0.0 - 2021-12-20 | ||
### Changed or removed | ||
@@ -15,2 +15,3 @@ - 7c43eab major(context): used named export in context (ealush) | ||
### Added | ||
- b0a9a14 feat(vest): use key prop to retain test state after reorder (#732) (Evyatar) | ||
- 220127b added(n4s): partial rule modifier (undefined) | ||
@@ -20,2 +21,3 @@ - b5ce72d feat(n4s): context propagation within enforce (undefined) | ||
### Fixed and improved | ||
- 9f9b970 vx: improve package.json generation (ealush) | ||
- f721b2d patch(vest): replace warns boolean flag with enum (ealush) | ||
@@ -22,0 +24,0 @@ - bed7040 vx: add back to workspace (ealush) |
{ | ||
"version": "2.0.0-next-03ba92", | ||
"version": "2.0.0-next-084233", | ||
"license": "MIT", | ||
@@ -30,6 +30,6 @@ "main": "./dist/cjs/context.js", | ||
"import": "./dist/es/context.production.js", | ||
"require": "./dist/cjs/context.js", | ||
"node": "./dist/cjs/context.js", | ||
"require": "./dist/cjs/context.production.js", | ||
"node": "./dist/cjs/context.production.js", | ||
"module": "./dist/es/context.production.js", | ||
"default": "./dist/cjs/context.js" | ||
"default": "./dist/cjs/context.production.js" | ||
}, | ||
@@ -36,0 +36,0 @@ "./package.json": "./package.json", |
@@ -7,2 +7,3 @@ # Context | ||
## How Context Works? | ||
The way context works is quite simple. Creating a context initializes a closure with a context storage object. When you run your context call, it takes your values, and places them in the context storage object. When your function finishes running, the context is cleared. | ||
@@ -129,11 +130,13 @@ | ||
#### But my function is still running. Why did the context clear? | ||
The async parts of your function are actually not executed along with your sync code, and even though you "await" it, the browser carries on and allows other code to run in between instead of blocking execution until your async code is complete. | ||
#### Ok, so what do I do? | ||
There are multiple strategies of handling async functions with context. | ||
1. Pulling your values from context right before your async call | ||
This is the most obvious and easiest to achieve, though not always what you need. The basic idea is that you take whatever you need from the context when it is still available to you. | ||
This is the most obvious and easiest to achieve, though not always what you need. The basic idea is that you take whatever you need from the context when it is still available to you. | ||
2. context.bind or context.run your async function to the context you extracted | ||
This is the next logical step - you have a function that you know should run later with your context. You can bind your context to it for delayed execution. When your function runs later down the line within your asynchronous code, internally it will still have access to whatever you bound to it. | ||
This is the next logical step - you have a function that you know should run later with your context. You can bind your context to it for delayed execution. When your function runs later down the line within your asynchronous code, internally it will still have access to whatever you bound to it. |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22170
15
254
141
0
1