( update: RuntimeFlagsPatch.RuntimeFlagsPatch )
| 3188 | |
| 3189 | /* @internal */ |
| 3190 | export const withRuntimeFlagsScoped = ( |
| 3191 | update: RuntimeFlagsPatch.RuntimeFlagsPatch |
| 3192 | ): Effect.Effect<void, never, Scope.Scope> => { |
| 3193 | if (update === RuntimeFlagsPatch.empty) { |
| 3194 | return core.void |
| 3195 | } |
| 3196 | return pipe( |
| 3197 | core.runtimeFlags, |
| 3198 | core.flatMap((runtimeFlags) => { |
| 3199 | const updatedRuntimeFlags = runtimeFlags_.patch(runtimeFlags, update) |
| 3200 | const revertRuntimeFlags = runtimeFlags_.diff(updatedRuntimeFlags, runtimeFlags) |
| 3201 | return pipe( |
| 3202 | core.updateRuntimeFlags(update), |
| 3203 | core.zipRight(addFinalizer(() => core.updateRuntimeFlags(revertRuntimeFlags))), |
| 3204 | core.asVoid |
| 3205 | ) |
| 3206 | }), |
| 3207 | core.uninterruptible |
| 3208 | ) |
| 3209 | } |
| 3210 | |
| 3211 | // circular with Scope |
| 3212 |
nothing calls this directly
no test coverage detected