SubscriptionRef overview
Added in v2.0.0
Table of contents
- constructors
- getters
- models
- symbols
- utils
constructors
make
Creates a new SubscriptionRef
with the specified value.
Signature
export declare const make: <A>(value: A) => Effect.Effect<SubscriptionRef<A>>
Added in v2.0.0
getters
get
Signature
export declare const get: <A>(self: SubscriptionRef<A>) => Effect.Effect<A>
Added in v2.0.0
models
SubscriptionRef (interface)
A SubscriptionRef<A>
is a Ref
that can be subscribed to in order to receive the current value as well as all changes to the value.
Signature
export interface SubscriptionRef<in out A>
extends SubscriptionRef.Variance<A>,
Synchronized.SynchronizedRef<A>,
Subscribable<A> {
/** @internal */
readonly ref: Ref.Ref<A>
/** @internal */
readonly pubsub: PubSub.PubSub<A>
/** @internal */
readonly semaphore: Effect.Semaphore
/**
* A stream containing the current value of the `Ref` as well as all changes
* to that value.
*/
readonly changes: Stream.Stream<A>
readonly [Unify.typeSymbol]?: unknown
readonly [Unify.unifySymbol]?: SubscriptionRefUnify<this>
readonly [Unify.ignoreSymbol]?: SubscriptionRefUnifyIgnore
}
Added in v2.0.0
SubscriptionRefUnify (interface)
Signature
export interface SubscriptionRefUnify<A extends { [Unify.typeSymbol]?: any }>
extends Synchronized.SynchronizedRefUnify<A> {
SubscriptionRef?: () => Extract<A[Unify.typeSymbol], SubscriptionRef<any>>
}
Added in v3.8.0
SubscriptionRefUnifyIgnore (interface)
Signature
export interface SubscriptionRefUnifyIgnore extends Synchronized.SynchronizedRefUnifyIgnore {
SynchronizedRef?: true
}
Added in v3.8.0
symbols
SubscriptionRefTypeId
Signature
export declare const SubscriptionRefTypeId: typeof SubscriptionRefTypeId
Added in v2.0.0
SubscriptionRefTypeId (type alias)
Signature
export type SubscriptionRefTypeId = typeof SubscriptionRefTypeId
Added in v2.0.0
utils
SubscriptionRef (namespace)
Added in v2.0.0
Variance (interface)
Signature
export interface Variance<in out A> {
readonly [SubscriptionRefTypeId]: {
readonly _A: Types.Invariant<A>
}
}
Added in v2.0.0
getAndSet
Signature
export declare const getAndSet: {
<A>(value: A): (self: SubscriptionRef<A>) => Effect.Effect<A>
<A>(self: SubscriptionRef<A>, value: A): Effect.Effect<A>
}
Added in v2.0.0
getAndUpdate
Signature
export declare const getAndUpdate: {
<A>(f: (a: A) => A): (self: SubscriptionRef<A>) => Effect.Effect<A>
<A>(self: SubscriptionRef<A>, f: (a: A) => A): Effect.Effect<A>
}
Added in v2.0.0
getAndUpdateEffect
Signature
export declare const getAndUpdateEffect: {
<A, R, E>(f: (a: A) => Effect.Effect<A, E, R>): (self: SubscriptionRef<A>) => Effect.Effect<A, E, R>
<A, R, E>(self: SubscriptionRef<A>, f: (a: A) => Effect.Effect<A, E, R>): Effect.Effect<A, E, R>
}
Added in v2.0.0
getAndUpdateSome
Signature
export declare const getAndUpdateSome: {
<A>(pf: (a: A) => Option.Option<A>): (self: SubscriptionRef<A>) => Effect.Effect<A>
<A>(self: SubscriptionRef<A>, pf: (a: A) => Option.Option<A>): Effect.Effect<A>
}
Added in v2.0.0
getAndUpdateSomeEffect
Signature
export declare const getAndUpdateSomeEffect: {
<A, R, E>(pf: (a: A) => Option.Option<Effect.Effect<A, E, R>>): (self: SubscriptionRef<A>) => Effect.Effect<A, E, R>
<A, R, E>(self: SubscriptionRef<A>, pf: (a: A) => Option.Option<Effect.Effect<A, E, R>>): Effect.Effect<A, E, R>
}
Added in v2.0.0
modify
Signature
export declare const modify: {
<A, B>(f: (a: A) => readonly [B, A]): (self: SubscriptionRef<A>) => Effect.Effect<B>
<A, B>(self: SubscriptionRef<A>, f: (a: A) => readonly [B, A]): Effect.Effect<B>
}
Added in v2.0.0
modifyEffect
Signature
export declare const modifyEffect: {
<B, A, E, R>(f: (a: A) => Effect.Effect<readonly [B, A], E, R>): (self: SubscriptionRef<A>) => Effect.Effect<B, E, R>
<A, B, E, R>(self: SubscriptionRef<A>, f: (a: A) => Effect.Effect<readonly [B, A], E, R>): Effect.Effect<B, E, R>
}
Added in v2.0.0
modifySome
Signature
export declare const modifySome: {
<B, A>(fallback: B, pf: (a: A) => Option.Option<readonly [B, A]>): (self: SubscriptionRef<A>) => Effect.Effect<B>
<A, B>(self: SubscriptionRef<A>, fallback: B, pf: (a: A) => Option.Option<readonly [B, A]>): Effect.Effect<B>
}
Added in v2.0.0
modifySomeEffect
Signature
export declare const modifySomeEffect: {
<A, B, R, E>(
fallback: B,
pf: (a: A) => Option.Option<Effect.Effect<readonly [B, A], E, R>>
): (self: Synchronized.SynchronizedRef<A>) => Effect.Effect<B, E, R>
<A, B, R, E>(
self: Synchronized.SynchronizedRef<A>,
fallback: B,
pf: (a: A) => Option.Option<Effect.Effect<readonly [B, A], E, R>>
): Effect.Effect<B, E, R>
}
Added in v2.0.0
set
Signature
export declare const set: {
<A>(value: A): (self: SubscriptionRef<A>) => Effect.Effect<void>
<A>(self: SubscriptionRef<A>, value: A): Effect.Effect<void>
}
Added in v2.0.0
setAndGet
Signature
export declare const setAndGet: {
<A>(value: A): (self: SubscriptionRef<A>) => Effect.Effect<A>
<A>(self: SubscriptionRef<A>, value: A): Effect.Effect<A>
}
Added in v2.0.0
update
Signature
export declare const update: {
<A>(f: (a: A) => A): (self: SubscriptionRef<A>) => Effect.Effect<void>
<A>(self: SubscriptionRef<A>, f: (a: A) => A): Effect.Effect<void>
}
Added in v2.0.0
updateAndGet
Signature
export declare const updateAndGet: {
<A>(f: (a: A) => A): (self: SubscriptionRef<A>) => Effect.Effect<A>
<A>(self: SubscriptionRef<A>, f: (a: A) => A): Effect.Effect<A>
}
Added in v2.0.0
updateAndGetEffect
Signature
export declare const updateAndGetEffect: {
<A, R, E>(f: (a: A) => Effect.Effect<A, E, R>): (self: SubscriptionRef<A>) => Effect.Effect<A, E, R>
<A, R, E>(self: SubscriptionRef<A>, f: (a: A) => Effect.Effect<A, E, R>): Effect.Effect<A, E, R>
}
Added in v2.0.0
updateEffect
Signature
export declare const updateEffect: {
<A, R, E>(f: (a: A) => Effect.Effect<A, E, R>): (self: Synchronized.SynchronizedRef<A>) => Effect.Effect<void, E, R>
<A, R, E>(self: Synchronized.SynchronizedRef<A>, f: (a: A) => Effect.Effect<A, E, R>): Effect.Effect<void, E, R>
}
Added in v2.0.0
updateSome
Signature
export declare const updateSome: {
<A>(f: (a: A) => Option.Option<A>): (self: SubscriptionRef<A>) => Effect.Effect<void>
<A>(self: SubscriptionRef<A>, f: (a: A) => Option.Option<A>): Effect.Effect<void>
}
Added in v2.0.0
updateSomeAndGet
Signature
export declare const updateSomeAndGet: {
<A>(pf: (a: A) => Option.Option<A>): (self: SubscriptionRef<A>) => Effect.Effect<A>
<A>(self: SubscriptionRef<A>, pf: (a: A) => Option.Option<A>): Effect.Effect<A>
}
Added in v2.0.0
updateSomeAndGetEffect
Signature
export declare const updateSomeAndGetEffect: {
<A, R, E>(pf: (a: A) => Option.Option<Effect.Effect<A, E, R>>): (self: SubscriptionRef<A>) => Effect.Effect<A, E, R>
<A, R, E>(self: SubscriptionRef<A>, pf: (a: A) => Option.Option<Effect.Effect<A, E, R>>): Effect.Effect<A, E, R>
}
Added in v2.0.0
updateSomeEffect
Signature
export declare const updateSomeEffect: {
<A, R, E>(
pf: (a: A) => Option.Option<Effect.Effect<A, E, R>>
): (self: Synchronized.SynchronizedRef<A>) => Effect.Effect<void, E, R>
<A, R, E>(
self: Synchronized.SynchronizedRef<A>,
pf: (a: A) => Option.Option<Effect.Effect<A, E, R>>
): Effect.Effect<void, E, R>
}
Added in v2.0.0