import {
SubscriptionRefInternal
} from "@effect/core/stream/SubscriptionRef/operations/_internal/SubscriptionRefInternal"
/**
* Creates a new `SubscriptionRef` with the specified value.
*
* @tsplus static effect/core/stream/SubscriptionRef.Ops make
* @tsplus static effect/core/stream/SubscriptionRef.Ops __call
*/
export function make(
value: LazyArg
): Effect> {
return Effect.suspendSucceed(
Do(($) => {
const ref = $(Ref.make(value))
const hub = $(Hub.unbounded())
const sem = $(TSemaphore.makeCommit(1))
return new SubscriptionRefInternal(ref, hub, sem)
})
)
}