(finalizerStrategy?: "sequential" | "parallel"): CloseableCreates a new Scope synchronously without wrapping it in an Effect.
This is useful when you need a scope immediately but should be used with caution
as it doesn't provide the same safety guarantees as the Effect-wrapped version.
When to use
Use when a scope must be allocated synchronously and the caller will close it manually.
Example (Creating a scope synchronously)
import { Console, Effect, Exit, Scope } from "effect"
// Create a scope immediately
const scope = Scope.makeUnsafe("sequential")
// Use it in an Effect program
const program = Effect.gen(function*() {
yield* Scope.addFinalizer(scope, Console.log("Cleanup"))
yield* Scope.close(scope, Exit.void)
})constructors
Source effect/Scope.ts:2811 lines
export const const makeUnsafe: (
finalizerStrategy?: "sequential" | "parallel"
) => Closeable
Creates a new Scope synchronously without wrapping it in an Effect.
This is useful when you need a scope immediately but should be used with caution
as it doesn't provide the same safety guarantees as the Effect-wrapped version.
When to use
Use when a scope must be allocated synchronously and the caller will close it
manually.
Example (Creating a scope synchronously)
import { Console, Effect, Exit, Scope } from "effect"
// Create a scope immediately
const scope = Scope.makeUnsafe("sequential")
// Use it in an Effect program
const program = Effect.gen(function*() {
yield* Scope.addFinalizer(scope, Console.log("Cleanup"))
yield* Scope.close(scope, Exit.void)
})
makeUnsafe: (finalizerStrategy: "sequential" | "parallel" | undefinedfinalizerStrategy?: "sequential" | "parallel") => Closeable = import effecteffect.const scopeMakeUnsafe: (
finalizerStrategy?: "sequential" | "parallel"
) => Scope.Closeable
scopeMakeUnsafeReferenced by 10 symbols