
In RxSwift, we should be careful while passing functions to operators which might cause a memory leak.
In this example, our main actor is RxSwiftTest class. It creates an observable in init and passes multiplyByTwo function to map operator to transform the result. Passing the function causes observable to…