I ended up writing this:
# reaktive
s
I ended up writing this:
a
Hello!
observableUnsafe {}
is equivalent to RxJava's
Observable.unsafeCreate {}
, whereas
observable {}
is equivalent to RxJava's
Observable.create {}
. So basically you can write something like this:
Copy code
observable<String> { emitter ->
        emitter.setDisposable(Disposable {  })
    }
You can also define the following extension for convenience:
Copy code
inline fun Emitter.setCancellable(crossinline cancellable: () -> Unit) {
    setDisposable(Disposable(cancellable))
}
I raised an issue to add this to the library, feel free to PR: https://github.com/badoo/Reaktive/issues/489
s
unthreading for visibility to others
I was trying to search for
observableCreate
. Took me some time to notice
observable {}
.