( // long life to reverse mapped types ...deps: TDepsArr<TDeps> )
| 135 | |
| 136 | // Note: the type here must be aligned with mergeContextProviders |
| 137 | export const MergedContextProvider = < |
| 138 | TDeps extends ReadonlyArray<any> |
| 139 | >( |
| 140 | // long life to reverse mapped types |
| 141 | ...deps: TDepsArr<TDeps> |
| 142 | ) => |
| 143 | pipe( |
| 144 | deps as [Parameters<typeof mergeContextProviders>[0]], |
| 145 | (_) => mergeContextProviders(..._), |
| 146 | (_) => ContextProvider(_ as any) |
| 147 | ) as unknown as ContextTagWithDefault< |
| 148 | ContextProviderId, |
| 149 | Effect.Effect< |
| 150 | // we need to merge all contexts into one |
| 151 | // v4: Service.Shape extracts the service value type (v3's Tag.Identifier) |
| 152 | Context.Context<GetContext<EffectGenUtils.Success<Context.Service.Shape<TDeps[number]>>>>, |
| 153 | never, |
| 154 | EffectGenUtils.Context<Context.Service.Shape<TDeps[number]>> |
| 155 | >, |
| 156 | LayerUtils.GetLayersError<{ [K in keyof TDeps]: TDeps[K]["Default"] }>, |
| 157 | // v4: Identifier here is correct — it's the nominal service identity for layer provide/exclude |
| 158 | | Exclude< |
| 159 | Context.Service.Identifier<TDeps[number]>, |
| 160 | LayerUtils.GetLayersSuccess<{ [K in keyof TDeps]: TDeps[K]["Default"] }> |
| 161 | > |
| 162 | | LayerUtils.GetLayersContext<{ [K in keyof TDeps]: TDeps[K]["Default"] }> |
| 163 | > |
| 164 | |
| 165 | export const EmptyContextProvider = ContextProvider({ effect: Effect.succeed(Effect.succeed(Context.empty())) }) |
no test coverage detected
searching dependent graphs…