CoreLocation State Store
What is CacheStore?
CacheStore is a SwiftUI state management framework that uses a dictionary as the state. Scoping creates a single source of truth for the parent state. CacheStore uses c, which a simple composition framework. c has the ability to create transformations that are either unidirectional or bidirectional.
publictypealiasLocationStore=Store<LocationStoreKey,LocationStoreAction,LocationStoreDependency>/// `LocationStore` Keys
/// - location: CLLocation
publicenumLocationStoreKey{case location // CLLocation
}/// `LocationStore` Actions
publicenumLocationStoreAction{case updateLocation
case locationUpdated(CLLocation?)}/// `LocationStore` Dependency
publicstructLocationStoreDependency{publicvarshouldContinuouslyUpdate:BoolpublicvarupdateLocation:()async->CLLocation?publicinit(
shouldContinuouslyUpdate:Bool=true,
updateLocation:@escaping()async->CLLocation?){self.shouldContinuouslyUpdate = shouldContinuouslyUpdate
self.updateLocation = updateLocation
}}/// Higher-order StoreActionHandler
publicfunc locationStoreActionHandler(
withActionHandler actionHandler:StoreActionHandler<LocationStoreKey,LocationStoreAction,LocationStoreDependency>?=nil)->StoreActionHandler<LocationStoreKey,LocationStoreAction,LocationStoreDependency>publicclass DefaultLocationStore: LocationStore