-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a observable using a operator
Devrath edited this page Dec 29, 2023
·
1 revision
/**
* Here it emits one emission from the observable with just one element
*/
fun oneEmission() {
val oneMovie : Observable<String> = Observable.just(episodeI)
}
/**
* Here the observable emits a sequence of emissions
*/
fun groupOfEmissions() {
val collectionOfMovies = Observable.just(episodeI,episodeII,episodeIII)
}
/**
* Creating a observable from a list of strings
*/
fun listOfEmissions() {
val lostOfMovies = Observable.just(listOf( episodeI, episodeII, episodeIII ))
}
/**
* Converting a list to observable using toObservable
*/
fun listToObservable() {
val observableMovieList = listOf( episodeI, episodeII, episodeIII ).toObservable()
}