What is a Single<Int>! and how can I instantiate a variable as it

Viewed 65

I'm trying to solve some test issues and I'm getting the error:

The integer literal does not conform to the expected type Single!

I've never worked with Single<> and I haven't been able to found how to instantiate a variable as one in Kotlin.

1 Answers

Found that the Single is a class from Reactivex and the way to create a variable as Single is:

Single.just(1)

And you can replace the "1" with what you want as the variable.

Related