Reputation: 1129
I've got a code, like this:
Observable
.create(...)
.map(client -> localClient = client)
.flatMap(client -> ...);
Does it just assigns "client" to some local instance "localClient" and returns it? Or i should explicitly write
Observable
.create(...)
.map(client -> {localClient = client; return client; })
.flatMap(client -> ...);
Upvotes: 0
Views: 262
Reputation: 21184
Your first snippet works as you want it to, the result of the assignment is returned so will become the client
that is passed through the rest of your Rx chain.
Upvotes: 1