Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Last active July 2, 2020 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencurtis/68eca7fb387d47c9d5df81e72c318be1 to your computer and use it in GitHub Desktop.
Save stevencurtis/68eca7fb387d47c9d5df81e72c318be1 to your computer and use it in GitHub Desktop.
mvireducer
struct Reducer {
func getNext(store: BehaviorRelay<State>) -> AppState {
let currentState = store.value
return AppState(
person: currentState.person,
currentIndex: (currentState.currentIndex + 1) % currentState.person.count)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment