Repository navigation
Releases
Releases · Woit/miniTCA
1.0.0
The first stable release: an actor-based, TCA-style store for Swift 6, built on the standard library alone.
API
Core
Store<State, Action, Environment>: anactorthat owns the state and processes actions one at a time.send(_:)isnonisolated: it enqueues and returns, from any thread, withoutawait.stateStream()yields the current state, then every state that differs from the previous one.
Reducer,Middleware,EffectandLoggertype aliases.AsyncStreamhelpers for middlewares:.none,.just(_:),.seq(_:),map(_:)andmerge(_:).
Modules (optional, for apps with many features)
Module: a feature with its own state, actions and dependencies.ActionRoute: picks the global actions a module handles and wraps its follow-ups back.ModuleRegistry: mounts modules into one store throughmakeReducers()andmakeMiddlewares().
Guarantees
- One FIFO queue for sent and emitted actions; actions sent from one task keep their order.
- Reducers run synchronously, in order, on every action. Subscribers see a state only if it changed.
- Every middleware starts as its own task with the post-reducer state, off the store's actor.
- Nothing keeps a store alive: once it is released, its state streams finish.
- There is no cancellation, and follow-ups from different middlewares arrive in no particular order.
STORE.md and MODULES.md describe the exact semantics; from now on they are part of the API, as the README's Source stability section says.
Requirements
Swift 6.0 or later. iOS 15, macOS 12, tvOS 15, watchOS 8, and Linux.
CI runs on Linux with Swift 6.0 and 6.4, and on macOS with Thread Sanitizer. It also builds for iOS and watchOS and checks four upcoming Swift features.