( set: Setter, regionId: string, environment: LoadedEnvironment, )
| 110 | }; |
| 111 | |
| 112 | export const setFakeEnvironment = async ( |
| 113 | set: Setter, |
| 114 | regionId: string, |
| 115 | environment: LoadedEnvironment, |
| 116 | ) => { |
| 117 | const environments = new Map<string, LoadedEnvironment>([ |
| 118 | [regionId, environment], |
| 119 | ] as const); |
| 120 | set(currentRegionIdAtom, regionId); |
| 121 | set(environmentsWithHealth, environments); |
| 122 | // This prevents components from suspending when the get the environment, unfortunately |
| 123 | // it's not clear why this works. |
| 124 | await getStore().get(currentEnvironmentState); |
| 125 | }; |
| 126 | |
| 127 | export type InitializeStateFn = (store: Store) => Promise<void> | void; |
| 128 |
no test coverage detected