Skip to content

Instantly share code, notes, and snippets.

@atimca
Created June 19, 2020 09:11
Show Gist options
  • Save atimca/80c7fe022e56d861928d3f182d0e4185 to your computer and use it in GitHub Desktop.
Save atimca/80c7fe022e56d861928d3f182d0e4185 to your computer and use it in GitHub Desktop.
func transform(
newsReducer: (NewsState, AppEvent) -> NewsState,
appStateIntoNews: (AppState) -> NewsState
) -> Reducer {
return { appState, appEvent in
let newsState = appStateIntoNews(appState)
return newsReducer(newsState, appEvent)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment