<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.
export const 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 = <function (type parameter) A in <A>(value: A): SynchronizedRef<A>A>(value: Avalue: function (type parameter) A in <A>(value: A): SynchronizedRef<A>A): 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): SynchronizedRef<A>A> => {
const const self: anyself = var Object: ObjectConstructorProvides functionality common to all JavaScript objects.
Object.ObjectConstructor.create(o: object | null): any (+1 overload)Creates an object that has the specified prototype or that has null prototype.
create(const Proto: {
"~effect/SynchronizedRef": string
toJSON(this: SynchronizedRef<any>): {
_id: string
value: any
}
pipe(): unknown
toString(): string
[NodeInspectSymbol](): any
}
Proto)
const self: anyself.semaphore = import SemaphoreSemaphore.makeUnsafe(1)
const self: anyself.backing = import RefRef.makeUnsafe(value: Avalue)
return const self: anyself
}