https://kotlinlang.org logo
Docs
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
rx
  • t

    thomasnield

    04/30/2017, 3:15 PM
    In the event we did a pure Rx implementation in Kotlin, would it make sense
    observeOn()
    ,
    subscribeOn()
    , and
    unsubscribeOn()
    would directly accept a
    CoroutineDispatcher
    instead of a
    Scheduler
    backed by a
    CoroutineDispatcher
    ?
    e
    t
    • 3
    • 2
  • t

    thomasnield

    05/02/2017, 12:19 AM
    https://github.com/ReactiveX/RxKotlin/releases/tag/2.0.1
    👍 3
    d
    • 2
    • 2
  • p

    Paul Woitaschek

    05/09/2017, 5:40 PM
    It hides it. You can't cast it after hide() and manipulate it.
    👍 4
    d
    • 2
    • 1
  • t

    trevjones

    05/10/2017, 9:16 PM
    refcount maybe?
    j
    • 2
    • 4
  • z

    zak.taccardi

    05/10/2017, 9:21 PM
    fun dataEmissions() : Observable<YourData>()
    and
    fun executeNetworkRequest(params: Params)
    (note 2nd method returns void).
    j
    • 2
    • 5
  • m

    muthuraj

    05/12/2017, 2:17 PM
    Hi all, If I use
    Completable.create {  }
    the
    CompletableOnSubscribe
    becomes null.
    Completable.create((CompletableOnSubscribe)null.INSTANCE);
    this is the decompiled version. Since it becomes null, anything I put inside create doesn’t work. But if I use
    Completable.create(object : CompletableOnSubscribe{
    override fun subscribe(e: CompletableEmitter?) {
    }
    })
    like this, then it is working fine.
    l
    • 2
    • 2
  • t

    thomasnield

    05/18/2017, 12:19 PM
    @elizarov good luck
    e
    • 2
    • 1
  • m

    mg6maciej

    06/05/2017, 9:38 PM
    Yes, you have turned it into machine that ignores next events. You will only get terminal if subject errors or completes or you get error inside flatMap.
    y
    • 2
    • 38
  • u

    uzias

    06/19/2017, 5:49 PM
    there is a lib to show log like a frodo but support in kotlin?
    s
    • 2
    • 2
  • g

    gregd

    06/25/2017, 6:49 PM
    @thomasnield Thanks for taking care of the SAM conversions in RxJava 2 ! 👍 So far RxKotlin it’s our only hope 😉 https://youtrack.jetbrains.com/issue/KT-14984
    s
    • 2
    • 2
  • g

    gregd

    06/26/2017, 7:59 PM
    @bdeg Of course when using
    vararg
    all the elements will have to be of the same type (e.g.
    Observable<String>
    ). So if your form has various types, this might me a problem. Maybe it would be better to use something like
    Observable.combineLatest()
    , which is parametrized (generics) and can handle up to 9 different Observables?
    b
    • 2
    • 2
  • t

    thomasnield

    07/03/2017, 9:33 PM
    https://github.com/ReactiveX/RxKotlin/blob/2.x/README.md#extensions
    :kotlin-flag: 1
    👍 7
    g
    • 2
    • 2
  • t

    thomasnield

    07/17/2017, 3:54 PM
    @peasee my book tries to make learning RxJava 2.0 less steep, shameless plug : ) https://www.packtpub.com/application-development/learning-rxjava
    p
    b
    • 3
    • 2
  • p

    peasee

    07/24/2017, 8:50 AM
    Wow thank you, I badly misunderstood that!
    g
    • 2
    • 2
  • d

    darkmoon_uk

    07/24/2017, 1:43 PM
    https://github.com/ReactiveX/RxKotlin/pull/139
  • t

    tulio

    07/24/2017, 5:53 PM
    Hi guys, does this logic makes sense for you? Or is there a better way of doing this?
    p
    • 2
    • 4
  • t

    tschuchort

    07/24/2017, 7:23 PM
    why do you subscribe and then do nothing with it?
    t
    • 2
    • 3
  • t

    thomasnield

    08/01/2017, 4:56 AM
    "Learning RxJava" is now only $10, get it while you can. https://www.packtpub.com/application-development/learning-rxjava
    👍 3
    m
    k
    +2
    • 5
    • 4
  • h

    Hawazine Haouat

    08/01/2017, 4:28 PM
    Hello everyone, I've posted a question on stackoverflow around Flowable, Rx, Kotlin, Retrofit2. Thanks to take a look if you can 👍 https://stackoverflow.com/questions/45441074/multiple-retrofit2-requests-using-flowable-in-kotlin
    k
    • 2
    • 22
  • k

    kioba

    08/07/2017, 9:00 PM
    What Dan uses
    .concat
    for is offline sync, so it depends on heavily what you meant on local observable. Basically he concat the 3 datasource and take the first available. So if you don’t have in the upper layers then you go deeper to the more expensive ones and update the upper ones. answering you question i would go with both of them, take local or network with the most uptodate data, but on the network call just update the local:
    fun getDistinctUsers() = Observable
            .concat(local, network.doOnNext{ data -> saveToLocal(data)})
            .first {data -> data.synced }
            .filter(SomeAlgorithm::distinct)
    👍 2
    v
    • 2
    • 1
  • g

    gabrielfv

    08/11/2017, 1:57 AM
    Well, It looks interesting, what exactly does it do?
    a
    • 2
    • 3
  • a

    adolgiy

    08/21/2017, 9:25 PM
    this is not allowed in case of canonical MVP also i’m use Moxy library for MVP (it’s awesome lib) and Moxy crashes on compile with view method returning non-void value
    a
    • 2
    • 17
  • f

    f.babic

    08/24/2017, 11:16 AM
    Hey guys, does anyone have problems with Kotlin and Rx when building the app. I’m using Kotlin’s Boolean type as the generic type : error: unexpected type private final io.reactivex.SingleObserver<boolean> addTripObserver() { ^ required: reference found: boolean java.lang.IllegalStateException: failed to analyze: org.jetbrains.kotlin.kapt3.diagnostic.KaptError: Error while annotation processing and it fails with Java
    • 1
    • 1
  • a

    alexsullivan114

    08/28/2017, 6:18 PM
    Gonna cross-post this here - let me know if it's off topic and I'll delete it. Hey guys - i feel like a dope asking this, but I cannot for the life of me figure out how to get the autoformatter in Android Studio to properly handle multiline method calls. So for example, I have the following code:
    Observable.just("Foo")
                .map { "Bar" }
                .filter { it == "Baz" }
                .doOnNext { print("Bat") }
                .subscribe { print(it) }
    if I try to autoformat it, it puts all the function calls on one line - i.e. it becomes this:
    Observable.just("Foo").map { "Bar" }.filter { it == "Baz" }.doOnNext { print("Bat") }.subscribe { print(it) }
    What option do I need to change in the kotlin code styles to keep the newlines?
    n
    • 2
    • 1
  • i

    igorbiscanin

    09/07/2017, 9:27 AM
    Hi can somebody help me with this error message
    Error:(114, 36) None of the following functions can be called with the arguments supplied:
    @CheckReturnValue @SchedulerSupport public final fun <T1 : Any!, T2 : Any!, R : Any!> combineLatest(p0: ((Observer<in String!>) -> Unit)!, p1: ((Observer<in String!>) -> Unit)!, p2: ((String, String) -> Boolean)!): Observable<Boolean!>! defined in io.reactivex.Observable
    @CheckReturnValue @SchedulerSupport public final fun <T : Any!, R : Any!> combineLatest(p0: ((Array<(out) Any!>) -> ???)!, p1: Int, p2: Array<(out) ObservableSource<out (???..???)>!>!): Observable<(???..???)>! defined in io.reactivex.Observable
    @CheckReturnValue @SchedulerSupport public open fun <T1 : Any!, T2 : Any!, R : Any!> combineLatest(p0: ObservableSource<out (???..???)>!, p1: ObservableSource<out (???..???)>!, p2: BiFunction<in (???..???), in (???..???), out (???..???)>!): Observable<(???..???)>! defined in io.reactivex.Observable
    @CheckReturnValue @SchedulerSupport public open fun <T : Any!, R : Any!> combineLatest(p0: Function<in Array<(out) Any!>!, out (???..???)>!, p1: Int, vararg p2: ObservableSource<out (???..???)>!): Observable<(???..???)>! defined in io.reactivex.Observable
    @CheckReturnValue @SchedulerSupport public final fun <T : Any!, R : Any!> combineLatest(p0: Array<(out) ObservableSource<out (???..???)>!>!, p1: ((Array<(out) Any!>) -> ???)!, p2: Int): Observable<(???..???)>! defined in io.reactivex.Observable
    @CheckReturnValue @SchedulerSupport public open fun <T : Any!, R : Any!> combineLatest(p0: Array<(out) ObservableSource<out (???..???)>!>!, p1: Function<in Array<(out) Any!>!, out (???..???)>!, p2: Int): Observable<(???..???)>! defined in io.reactivex.Observable
    @CheckReturnValue @SchedulerSupport public final fun <T : Any!, R : Any!> combineLatest(p0: (Mutable)Iterable<ObservableSource<out (???..???)>!>!, p1: ((Array<(out) Any!>) -> ???)!, p2: Int): Observable<(???..???)>! defined in io.reactivex.Observable
    @CheckReturnValue @SchedulerSupport public open fun <T : Any!, R : Any!> combineLatest(p0: (Mutable)Iterable<ObservableSource<out (???..???)>!>!, p1: Function<in Array<(out) Any!>!, out (???..???)>!, p2: Int): Observable<(???..???)>! defined in io.reactivex.Observable
    code sample:
    val usernameObservable = RxTextView.textChanges(et_username)
    			.map { it -> Constants.emailPattern.matcher(it).matches() }
    			.distinctUntilChanged()
    			.subscribe()
    
    		val passwordObservable = RxTextView.textChanges(et_password)
    			.map { it -> it.isNotEmpty()}
    			.distinctUntilChanged()
    			.subscribe()
    
    		val signInEnabledCondition = BiFunction({ username: CharSequence, password: CharSequence ->
    			username.isNotEmpty() && password.isNotEmpty()
    		})
    
    		val isSignInEnabled = Observable.combineLatest(usernameObservable, passwordObservable, signInEnabledCondition)
    
    		isSignInEnabled.distinctUntilChanged().subscribe { enabled: Boolean -> bt_sign_in.isEnabled = enabled }
    b
    • 2
    • 6
  • j

    jw

    09/09/2017, 11:36 PM
    i built one: https://github.com/JakeWharton/Reagent
    p
    • 2
    • 1
  • a

    alex.hart

    09/11/2017, 12:48 PM
    The greatest FAQ on Reagent
    😆 1
    b
    • 2
    • 1
  • a

    artem_zin

    09/11/2017, 4:22 PM
    hm, I think it’s valuable to rewrite RxJava in pure Kotlin so you could reuse same business logic on JVM, JS and Native, but I don’t understand desire to couple implementation to coroutines, rx removes need in coroutines, it’s like rewriting Rx on top of
    AsyncTask
    d
    • 2
    • 1
  • t

    trevjones

    09/11/2017, 5:07 PM
    one might speculate that a large portion of custom operators people write can exists as combinations of existing ones wrapped up inside of an extension method anyway?
    a
    • 2
    • 1
  • t

    thomasnield

    09/11/2017, 11:28 PM
    David Karnok wrote another article on coroutines and RxJava
    b
    • 2
    • 3
Powered by Linen
Title
t

thomasnield

09/11/2017, 11:28 PM
David Karnok wrote another article on coroutines and RxJava
b

bamdmux

09/12/2017, 7:15 AM
"This was somewhat a heated week for me so for now, until something interesting comes up in this topic, me writing about Kotlin Coroutines will be ... suspended."
Thats unfortunate
I of course understand his point, but this kind of discussions/different points is always welcome
View count: 2