RxSwift: Just Operator
.just
operator creates an observable sequence containingjust
a single element and a.completed
event.- Type inference means we don’t need to define the type.
let lotteryNumberOne = 1
let lotteryNumberTwo = 2
let lotteryNumberThree = 3
let observable: Observable<Int> = Observable<Int>.just(lotteryNumberOne)
// Observable containing just lotteryNumberOne i.e. 1
< All Posts