(callback: (isolationScope: Scope) => T)
| 55 | } |
| 56 | |
| 57 | function withIsolationScope<T>(callback: (isolationScope: Scope) => T): T { |
| 58 | const scope = getScopes().scope; |
| 59 | const isolationScope = getScopes().isolationScope.clone(); |
| 60 | return asyncStorage.run({ scope, isolationScope }, () => { |
| 61 | return callback(isolationScope); |
| 62 | }); |
| 63 | } |
| 64 | |
| 65 | function withSetIsolationScope<T>(isolationScope: Scope, callback: (isolationScope: Scope) => T): T { |
| 66 | const scope = getScopes().scope; |