tokopedia / RxComposableArchitecture

RxComposableArchitecture is a forked of Composable Architecture with adjustment to make it work with UIKit.
Apache License 2.0
31 stars 5 forks source link

Add cancel overloads that take types #48

Closed ivanbagaskara closed 2 years ago

ivanbagaskara commented 2 years ago

While it's easy enough to create instances of hashable structs for cancel tokens, it's effectively using static info under the hood (more so as of https://github.com/tokopedia/RxComposableArchitecture/pull/47). So let's consider adding overloads that take Any.Type instead. In use:

-struct CancelId: Hashable {}
-return .cancel(id: CancelId())
+enum CancelId {}
+return .cancel(id: CancelId.self)