Skip to content

Instantly share code, notes, and snippets.

@luks91
Last active October 16, 2017 01:01
Show Gist options
  • Save luks91/b04adee0021b84cabef5c51d977c3766 to your computer and use it in GitHub Desktop.
Save luks91/b04adee0021b84cabef5c51d977c3766 to your computer and use it in GitHub Desktop.
class Flowables private constructor(){
companion object {
inline fun <T, S> generateWith(noinline initialState: () -> S, crossinline generator: (S, Emitter<T>) -> S)
= Flowable.generate(Callable<S>(initialState), BiFunction<S, Emitter<T>, S> { a, b -> generator.invoke(a, b) })
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment