File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,20 @@ import { apply } from "./apply.ts";
2
2
import type { Context } from "./context.ts" ;
3
3
import { Scope as _Scope , type Scope } from "./scope.ts" ;
4
4
5
- export const PROVIDERS : Map < ResourceKind , Provider < string , any > > = new Map <
5
+ declare global {
6
+ var ALCHEMY_PROVIDERS : Map < ResourceKind , Provider < string , any > > ;
7
+ var ALCHEMY_DYNAMIC_RESOURCE_RESOLVERS : DynamicResourceResolver [ ] ;
8
+ }
9
+
10
+ export const PROVIDERS : Map <
11
+ ResourceKind ,
12
+ Provider < string , any >
13
+ > = ( globalThis . ALCHEMY_PROVIDERS ??= new Map <
6
14
ResourceKind ,
7
15
Provider < string , any >
8
- > ( ) ;
9
- const DYNAMIC_RESOURCE_RESOLVERS : DynamicResourceResolver [ ] = [ ] ;
16
+ > ( ) ) ;
17
+ const DYNAMIC_RESOURCE_RESOLVERS : DynamicResourceResolver [ ] =
18
+ ( globalThis . ALCHEMY_DYNAMIC_RESOURCE_RESOLVERS ??= [ ] ) ;
10
19
11
20
export type DynamicResourceResolver = (
12
21
typeName : string ,
You can’t perform that action at this time.
0 commit comments