@preconcurrency static func tracking<Value>(region: any DatabaseRegionConvertible, _ otherRegions: any DatabaseRegionConvertible..., fetch: @escaping (Database) throws -> Value) -> ValueObservation<Reducer> where Reducer == ValueReducers.Fetch<Value>, Value : Sendable
Creates a ValueObservation
that notifies the fetched value whenever the provided regions are modified.
func handleEvents(willStart: (() -> Void)? = nil, willFetch: (() -> Void)? = nil, willTrackRegion: ((DatabaseRegion) -> Void)? = nil, databaseDidChange: (() -> Void)? = nil, didReceiveValue: ((Reducer.Value) -> Void)? = nil, didFail: ((Error) -> Void)? = nil, didCancel: (() -> Void)? = nil) -> ValueObservation<ValueReducers.Trace<Reducer>>
Performs the specified closures when observation events occur.
@preconcurrency @MainActor func start(in reader: any DatabaseReader, scheduling scheduler: some ValueObservationMainActorScheduler = .mainActor, onError: @escaping @MainActor (Error) -> Void, onChange: @escaping @MainActor (Reducer.Value) -> Void) -> AnyDatabaseCancellable
Starts observing the database and notifies fresh values on the main actor.