Swift Xcode MIT

SwiftTinyRedux is a barebone, thread-safe Redux-like container for Swift. It features a minimal API and supports composable reducers. It was designed to bring Redux’s core idea to Swift. You can find an article outlining the motivation behind it and the way it works internally here. This minimal README.md assumes prior Redux (or TCA) knowledge.

To set up a container using multiple reducers:

let bootstrapReducer: Reducer<AppState, AppAction, AppEnvironment> = { state, action in
    switch action {
    case .didBecomeActive:
        state.phase = .active
        state.navigation.history = ["/launching"]
        return { env, dispatch in
            it let user = await env.identity.fetchUser() {
            else {

let navigationReducer: Reducer<NavigationState, NavigationAction, NavigationEnvironment> = { state, action in
    switch action {
    case let .present(path):
    case .dismiss:
        if state.history.count > 0 {

let initialState = AppState()
let environment = AppEnvironment()
let store = MainStore(initialState: initialState,
                      environment: environment)
store.add(reducer: bootstrapReducer)
store.add(reducer: navigationReducer,
          state: \.navigation,
          environment: \.navigation)
// Later on, map any state key path to interested parties.
store.map(\.navigation.history.last, to: &viewmodel.$currentPath)


View Github