(u: unknown): u is SubscriptionRef<unknown>Returns true if the provided value is a SubscriptionRef.
When to use
Use to narrow an unknown value before calling SubscriptionRef operations
that require a subscription reference.
export const const isSubscriptionRef: (
u: unknown
) => u is SubscriptionRef<unknown>
Returns true if the provided value is a SubscriptionRef.
When to use
Use to narrow an unknown value before calling SubscriptionRef operations
that require a subscription reference.
isSubscriptionRef: (u: unknownu: unknown) => u: unknownu is interface SubscriptionRef<in out A>A mutable reference whose updates are serialized and published to
subscribers.
When to use
Use to observe the current value and subsequent updates as a
stream.
The SubscriptionRef namespace containing type definitions associated with
subscription references.
SubscriptionRef<unknown> = (
u: unknownu: unknown
): u: unknownu is interface SubscriptionRef<in out A>A mutable reference whose updates are serialized and published to
subscribers.
When to use
Use to observe the current value and subsequent updates as a
stream.
The SubscriptionRef namespace containing type definitions associated with
subscription references.
SubscriptionRef<unknown> => hasProperty<"~effect/SubscriptionRef">(self: unknown, property: "~effect/SubscriptionRef"): self is { [K in "~effect/SubscriptionRef"]: unknown; } (+1 overload)Checks whether a value has a given property key.
When to use
Use when you need a Predicate guard for property access on unknown
values with a simple structural object check.
Details
Uses the in operator and isObjectKeyword. This does not check property
value types.
Example (Guarding object properties)
import { Predicate } from "effect"
const hasName = Predicate.hasProperty("name")
const data: unknown = { name: "Ada" }
if (hasName(data)) {
console.log(data.name)
}
hasProperty(u: unknownu, const TypeId: "~effect/SubscriptionRef"TypeId)