Skip to content

Instantly share code, notes, and snippets.

@charlag
Created September 10, 2017 10:13
Show Gist options
  • Save charlag/ae6ded9306b417482d5adb9d3f7b8f7a to your computer and use it in GitHub Desktop.
Save charlag/ae6ded9306b417482d5adb9d3f7b8f7a to your computer and use it in GitHub Desktop.
val transformer = store.publish { upstream →
Observable.merge(
upstream.ofEventType<NameChangeEvent>.switchMap { (_, state, _) →
api.validate(state.name)
}
.map { apiResult → ValidationResult(…) },
upstream.ofEventType<OtherEvent>.map { …. }
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment