The Simplest RxJava Observable Sample App
Adam Hurwitz

Adam Hurwitz,

You misunderstood me, it wasn’t a question but a statement.

The problem with this kind of function — map(t -> { t.setVal(false); return t; }) is that it produces a different result every time it is called. This makes it easy to create bugs, hard to debug and hard to unit test.

A better approach would be to create a new object so we are not changing the original object at all — map(t -> new Object(false)).. now we don’t have to worry about concurrent modification of the ‘val’ variable inside the Object class.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.