( update: RuntimeFlagsPatch.RuntimeFlagsPatch )
| 3178 | |
| 3179 | /* @internal */ |
| 3180 | export const withRuntimeFlagsScoped = ( |
| 3181 | update: RuntimeFlagsPatch.RuntimeFlagsPatch |
| 3182 | ): Effect.Effect<void, never, Scope.Scope> => { |
| 3183 | if (update === RuntimeFlagsPatch.empty) { |
| 3184 | return core.void |
| 3185 | } |
| 3186 | return pipe( |
| 3187 | core.runtimeFlags, |
| 3188 | core.flatMap((runtimeFlags) => { |
| 3189 | const updatedRuntimeFlags = runtimeFlags_.patch(runtimeFlags, update) |
| 3190 | const revertRuntimeFlags = runtimeFlags_.diff(updatedRuntimeFlags, runtimeFlags) |
| 3191 | return pipe( |
| 3192 | core.updateRuntimeFlags(update), |
| 3193 | core.zipRight(addFinalizer(() => core.updateRuntimeFlags(revertRuntimeFlags))), |
| 3194 | core.asVoid |
| 3195 | ) |
| 3196 | }), |
| 3197 | core.uninterruptible |
| 3198 | ) |
| 3199 | } |
| 3200 | |
| 3201 | // circular with Scope |
| 3202 |
nothing calls this directly
no test coverage detected