Accumulation
scanvariable
Stateful scan over a
RefSubject/Computed, producing aComputedof the accumulated state.Fx subscriptions follow
Fx.scansemantics (emitinitial, then fold each source value). Effect sampling accumulates across source versions via a private state ref (do not mix heavy subscribe + sample on the same scan if you need a single shared accumulator).scanEffectvariable
Effectful stateful scan over a
RefSubject/Computed, producing aComputedof the accumulated state.
Construction options
RefSubjectOptionsinterface
Defines the ref subject options state contract.
Constructors
makefunction
Creates a new
RefSubjectfrom a value,Effect, orFx.
Derived queries
makeComputedfunction
Builds a read-only Computed projection from a Versioned source.
mapvariable
Transforms a
RefSubject,Computed, orFilteredusing a pure function.mapEffectvariable
Transforms a
RefSubject,Computed, orFilteredusing anEffectful function.proxyvariable
Extract all values from an object using a Proxy. Allows accessing nested properties of a
ComputedorFilteredobject/array as individual computed values.
Hydration construction
hydratefunction
Creates a named hydrated RefSubject using a string-encoded Schema codec.
hydrateAllfunction
Combines hydrated refs into one serialization and restoration boundary.
Hydration protocol
HYDRATION_ATTRIBUTEvariable
Canonical data attribute for the versioned envelope of unnamed hydrated refs.
HydrateOptionsinterface
Defines the hydrate options state contract.
HydratedRefSubjectinterface
Defines the hydrated ref subject state contract.
HydrationAttributeinterface
Defines the hydration attribute state contract.
HydrationElementinterface
Defines the hydration element state contract.
HydrationRefinterface
Defines the hydration ref state contract.
HydrationRefTypeIdvariable
Runtime symbol exposing hydration metadata on a hydrated RefSubject.
Hydration types
HydratedRefSubject.Anytype-alias
Describes the any type.
HydratedRefSubject.HydrationErrortype-alias
Describes the hydration error type.
HydratedRefSubject.HydrationServicestype-alias
Describes the hydration services type.
Observation policy
CurrentComputedBehaviorvariable
Selects whether a computed Fx observes only its current value or also follows later pushes.
slicevariable
Limits which pushed versions a RefSubject view observes without changing its state.
Optional queries
compactvariable
Converts a
ComputedorFilteredofOption<A>into aFiltered<A>, filtering outNonevalues.filterMapvariable
Filters and transforms a
RefSubject,Computed, orFilteredusing a pure function that returns anOption.filterMapEffectvariable
Filters and transforms a
RefSubject,Computed, orFilteredusing anEffectful function that returns anOption.getOrElsevariable
Returns a
Computedthat yields the value inside theOption, or the fallback whenNone. Works withComputed<Option<A>>(e.g. fromfromOption/fromNullable) and withFiltered<A>.makeFilteredfunction
Builds a Filtered view from the three channels of a Versioned source.
Read-only state
Computedinterface
A
Computedis a read-only view of a value that can change over time. It is anFxthat emits the current value and subsequent updates. It is also anEffectthat samples the current value.Filteredinterface
A
Filteredis aComputedthat may not always have a value. It is essentially aComputed<Option<A>>with helper methods.
Services
RefSubject.Classinterface
Defines the class state contract.
RefSubject.Serviceinterface
Defines the service state contract.
Servicefunction
Creates a Context-backed RefSubject service facade and Layer constructors.
computedFromServicefunction
Lifts an Effect-provided Computed into a Computed facade.
filteredFromServicefunction
Defers retrieval of a Filtered value from Effect Context while preserving Filtered behavior.
Source adapters
fromEffectfunction
Creates a
RefSubjectfrom anEffect.fromFxfunction
Creates a
RefSubjectfrom anFx, tracking the latest emitted value.fromNullablefunction
Creates Option-valued RefSubject state from a nullable input.
fromOptionfunction
Creates a
RefSubjectfrom anOptionvalue.fromStreamfunction
Creates a RefSubject that tracks the latest value emitted by an Effect Stream.
State composition
State updates
decrementfunction
Decrements a numeric
RefSubjectby 1.deletefunction · Re-export
Resets a
RefSubjectto its initial value, returning the previous value if it existed.incrementfunction
Increments a numeric
RefSubjectby 1.resetfunction
Resets a
RefSubjectto its initial value, returning the previous value if it existed.setvariable
Sets the value of a
RefSubject.updatevariable
Updates a
RefSubjectusing a pure function.updateEffectvariable
Updates a
RefSubjectusing anEffectful function.
Transactions
GetSetDeleteinterface
Interface for basic RefSubject operations: get, set, delete.
modifyvariable
Modifies a
RefSubjectusing a pure function that returns both a result and a new value.modifyEffectvariable
Modifies a
RefSubjectusing anEffectful function that returns both a result and a new value.runUpdatesvariable
Runs an effect that can modify a
RefSubjecttransactionally, with optional interrupt handling.
Type guards
isComputedfunction
Tests whether a value carries the public Computed TypeId.
isHydrationReffunction
Tests whether a value carries callable hydration metadata.
isRefSubjectfunction
Checks if a value is a
RefSubject.
Type identity
ComputedTypeIdvariable
Runtime symbol identifying read-only Computed values.
FilteredTypeIdvariable
Runtime symbol identifying conditionally available Filtered values.
RefSubjectTypeIdvariable
Runtime symbol identifying writable RefSubject values.
Type utilities
Computed.Anytype-alias
Describes the any type.
Errortype-alias
Describes the error type.
Filtered.Anytype-alias
Describes the any type.
Identifiertype-alias
Describes the identifier type.
RefSubject.Anytype-alias
Describes the any type.
Servicestype-alias
Describes the services type.
Successtype-alias
Describes the success type.
Writable state
RefSubjectinterface
A
RefSubjectis a mutable reference that can be observed as an Fx. It combines the capabilities of aRef(get/set/update) with aSubject(subscribe).
Writable views
transformvariable
Transforms a
RefSubjectinvariantly using bidirectional mapping functions.