<A>(value: A): Effect.Effect<SynchronizedRef<A>>Creates a SynchronizedRef from an initial value, wrapped in an Effect.
When to use
Use to create a SynchronizedRef inside an Effect program when later updates
may run effects and must be serialized.
Details
The returned effect constructs a fresh SynchronizedRef by delegating to
makeUnsafe when the effect is evaluated.
export const const make: <A>(
value: A
) => Effect.Effect<SynchronizedRef<A>>
Creates a SynchronizedRef from an initial value, wrapped in an Effect.
When to use
Use to create a SynchronizedRef inside an Effect program when later updates
may run effects and must be serialized.
Details
The returned effect constructs a fresh SynchronizedRef by delegating to
makeUnsafe when the effect is evaluated.
make = <function (type parameter) A in <A>(value: A): Effect.Effect<SynchronizedRef<A>>A>(value: Avalue: function (type parameter) A in <A>(value: A): Effect.Effect<SynchronizedRef<A>>A): import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<interface SynchronizedRef<in out A>A mutable reference whose update and modify operations are serialized with an
internal semaphore, including effectful transformations.
When to use
Use when shared state may be updated by multiple fibers and each update,
including effectful state transitions, must observe one current value and run
one at a time.
SynchronizedRef<function (type parameter) A in <A>(value: A): Effect.Effect<SynchronizedRef<A>>A>> => import EffectEffect.sync(() => const makeUnsafe: <A>(
value: A
) => SynchronizedRef<A>
Creates a SynchronizedRef synchronously from an initial value.
When to use
Use when you need synchronous SynchronizedRef construction outside an
Effect workflow.
makeUnsafe(value: Avalue))