Skip to content

Instantly share code, notes, and snippets.

@noxt
Created February 19, 2019 11:46
Show Gist options
  • Save noxt/1897603535f46aa39f60dae401dc9dac to your computer and use it in GitHub Desktop.
Save noxt/1897603535f46aa39f60dae401dc9dac to your computer and use it in GitHub Desktop.
AppFeature Reducer
// Features/App/AppReducer.swift
extension AppFeature {
static func reduce(_ old: State, with action: Action) -> State {
return State(
accountsState: AccountsFeature.reduce(old.accountsState, with: action),
categoriesState: CategoriesFeature.reduce(old.categoriesState, with: action),
keyboardState: KeyboardFeature.reduce(old.keyboardState, with: action),
transactionState: TransactionFeature.reduce(old.transactionState, with: action)
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment