| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 93cecb4 commit 6f77d1a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -223,8 +223,9 @@ added: | |||
| 223 | 223 | * `...args` {any} | |
| 224 | 224 | ||
| 225 | 225 | Runs a function synchronously within a context and returns its | |
| 226 | - return value. The store is not accessible outside of the callback function or | ||
| 227 | - the asynchronous operations created within the callback. | ||
| 226 | + return value. The store is not accessible outside of the callback function. | ||
| 227 | + The store is accessible to any asynchronous operations created within the | ||
| 228 | + callback. | ||
| 228 | 229 | ||
| 229 | 230 | The optional `args` are passed to the callback function. | |
| 230 | 231 | ||
@@ -238,6 +239,9 @@ const store = { id: 2 }; | |||
| 238 | 239 | try { | |
| 239 | 240 | asyncLocalStorage.run(store, () => { | |
| 240 | 241 | asyncLocalStorage.getStore(); // Returns the store object | |
| 242 | + setTimeout(() => { | ||
| 243 | + asyncLocalStorage.getStore(); // Returns the store object | ||
| 244 | + }, 200); | ||
| 241 | 245 | throw new Error(); | |
| 242 | 246 | }); | |
| 243 | 247 | } catch (e) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments