Skip to content

Repository files navigation

LocationCacheStore

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.

LocationStore

publictypealiasLocationStore=Store<LocationStoreKey,LocationStoreAction,LocationStoreDependency>

Keys

/// `LocationStore` Keys
/// - location: CLLocation
publicenumLocationStoreKey{case location // CLLocation
}

Actions

/// `LocationStore` Actions
publicenumLocationStoreAction{case updateLocation
case locationUpdated(CLLocation?)}

Dependency

/// `LocationStore` Dependency
publicstructLocationStoreDependency{publicvarshouldContinuouslyUpdate:BoolpublicvarupdateLocation:()async->CLLocation?publicinit(
shouldContinuouslyUpdate:Bool=true,
updateLocation:@escaping()async->CLLocation?){self.shouldContinuouslyUpdate = shouldContinuouslyUpdate
self.updateLocation = updateLocation
}}

StoreActionHandler

/// Higher-order StoreActionHandler
publicfunc locationStoreActionHandler(
withActionHandler actionHandler:StoreActionHandler<LocationStoreKey,LocationStoreAction,LocationStoreDependency>?=nil)->StoreActionHandler<LocationStoreKey,LocationStoreAction,LocationStoreDependency>

DefaultLocationStore

publicclass DefaultLocationStore: LocationStore

About

CoreLocation Store using CacheStore

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages