cancelled the previous subscription

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2022-10-24 13:46:21 -05:00
parent c93a270b1a
commit ae431b8b2b

View File

@ -26,7 +26,13 @@ open class Toggle: ToggleBase, VDSMoleculeViewProtocol {
public var viewModel: ToggleModel!
public var delegateObject: MVMCoreUIDelegateObject?
public var additionalData: [AnyHashable: Any]?
public var valueChangedSubscription: AnyCancellable?
public var valueChangedSubscription: AnyCancellable? {
willSet{
if let current = valueChangedSubscription {
current.cancel()
}
}
}
//--------------------------------------------------
// MARK: - Initializers