"Value is never used as Publisher" - what does this mean?
Answered
I've started seeing warnings "Value is never used as Publisher ", for example from this code:
override val locationObserver: Observable<Location> = Observable.create {
emitter = it
}
I have no idea what this means. The value certainly does get used elsewhere. Now I could just disable the inspection but I would like to know what it means before doing that.
Please sign in to leave a comment.
May you share entire code sample?
Inspection description could be found under Settings (Preferences on macOS) | Editor | Inspections | Reactive Streams | Common | Unused publisher: https://i.imgur.com/Nw0Kubn.png
at the same place, you can disable it.
Here is a complete sample. So from the description this is actually a bug (false positive) - the Provider *is* subscribed to.
Will be fixed in IntelliJ IDEA 2020.3. We are working on backporting to 2020.2: https://youtrack.jetbrains.com/issue/IDEA-245639