LavaUI docs GitHub

class StateStorage

Swift

final class StateStorage<Value>

The value that actually persists across view rebuilds.

@Observable is what makes a read inside withObservationTracking register a dependency, so this is both the storage and the change source.

Sources/LavaUI/State.swift:26

Properties

var value: Value { get set }

The stored value. Reading it inside a body makes that body depend on it; writing it re-runs the bodies that read it.

Sources/LavaUI/State.swift:29