Skip to content
ChiefVenzox edited this page Jun 5, 2026 · 1 revision

FAQ

Is SwiftState only for SwiftUI?

SwiftState is designed for Swift and SwiftUI. The store itself is not a view, but SwiftUI gets first-class helpers such as ObservableObject, @Published state, and Binding support.

Should I use Store or TimeTravelStore?

Use Store for normal production state management.

Use TimeTravelStore while developing when you want undo, redo, jump, and debugger history.

Can I use async/await?

Yes. Use EffectReducer and return .run { dispatch in ... } for async work.

Does every action need to change state?

No. If a reducer ignores an action and state stays equal, TimeTravelStore does not record a new history item.

Where should API clients live?

Keep API clients outside state. Inject them into reducer construction or capture them in the effect reducer closure.

Can I compose feature reducers?

Yes. Use combineReducers, combineEffectReducers, and pullback.

Why does Action use runtime casting?

SwiftState keeps the root store generic over state while actions conform to a shared Action protocol. Reducers cast only the actions they understand and ignore the rest.

Does SwiftState include cancellation?

Not yet. Async effects are intentionally small and simple today. Cancellation by ID is a good future enhancement.

Clone this wiki locally