Comments (4)
observableFunction.subscribeBy(
onNext = { status ->
println("onNext")
// Do the task in onComplete function
onComplete()
},
onError = {},
onComplete = ::onComplete
)
fun onComplete() = println("onComplete after onNext")
Why you could ever need to call onComplete
twice?
from rxkotlin.
I think it's more of a generic question rather than that he needs twice.
from rxkotlin.
@elton2048 you should let RxJava call onComplete
for you once the sequence terminates. There is absolutely no reason you should ever have to call it from onNext
. Do you need some resources to demystify RxJava events? I can provide some...
from rxkotlin.
@thomasnield You are right. The onComplete
call should be called in the function if using create() method to build Observable but not in the subscribe function. Thanks for that.
from rxkotlin.
Related Issues (20)
- RxKotlin is not resolved properly after updating Gradle to 3.4.0 HOT 17
- Admin Help - Adding a Collaborator HOT 5
- withLatestFrom() build error with RxKotlin 2.4.0 HOT 1
- Do we need to call onComplete() of subject in onDestroy() method of activity ? HOT 2
- Add mapNotNull extension HOT 1
- RxJava 3 support HOT 6
- Question about contributing: code styles
- RxKotlin 3 package name HOT 7
- Compilation error HOT 2
- Type mismatch for return type
- observeOn(AndroidSchedulers.mainThread()) HOT 2
- zipWith and Kotlin 1.4.0 HOT 4
- Add support for doOnLifecycle.
- Singles.zip does not invoke onError when one of the stream throws error
- issue with the indirect dependency component reactive-stream License
- `delay` extension reduces type detection (for `Observable.create` series)
- Update Kotlin version to use Duration?
- Kotlin multiplaform support HOT 1
- Issues with generics in Kotlin 1.8.0
- extensions for coroutine flow HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxkotlin.