feat: add interactor - #1532
Conversation
bigearsenal
left a comment
There was a problem hiding this comment.
In general I like this idea.
|
|
||
| private func bindToInteractor() { | ||
| interactor.transferAccountsPublisher | ||
| .assignWeak(to: \.transferAccounts, on: self) |
There was a problem hiding this comment.
For iOS 15 we can use assign(to: &$transferAccounts) directly (without .store)
https://developer.apple.com/documentation/combine/publisher/assign(to:)
| CryptoEthereumAccountsAggregator().transform(input: (state.value, actions)) | ||
| } | ||
|
|
||
| private lazy var solanaAccountsPublisher = Publishers |
There was a problem hiding this comment.
Should we mark it at lazy var (should interactor always keep reference of this publisher)? I think computed property is enough, since it doesn't required to store Publisher in memory
| private var subscriptions = Set<AnyCancellable>() | ||
| private var defaultsDisposables: [DefaultsDisposable] = [] | ||
|
|
||
| private var _transferAccountsPublisher = CurrentValueSubject<[any RenderableAccount], Never>([]) |
There was a problem hiding this comment.
This can be named transferAccountsSubject to distinguish with transferAccountPublisher.
| import Web3 | ||
| import Wormhole | ||
|
|
||
| protocol CryptoAccountsInteractorProtocol { |
There was a problem hiding this comment.
We agreed (when we didn't have you with us) naming protocol as CryptoAccountsInteractor and Implementation with suffix Impl (CryptoAccountsInteractorImpl). Let's follow this pattern
Description of the changes