public struct ActionSubscription
Subscription structure that represents a listener subscription. When adding a listener you get a subscription back. You can use this subscription to remove the listener, notify about the current state or link the listener lifecycle with an object.
Remove the listner associated with this subscription. After calling
removeListenerthe listener won’t be notified anymore.
let subscription = store.addActionListener(...) subscription.removeListener()
public func removeListener()
Link the listener associated with this subscription with an object. When the object gets deallocated the listener is removed. Useful when adding listeners that updates a UIView. You can link the listener lifecycle to the UIView’s lifecycle. When the UIView is removed (deallocated) the listener will be removed and will stop it from being notified.
let view = SomeUIVIew() // Listener updates the view let subscription = store.addActionListener(...) // Link the listener lifecycle to the view. No need to manually call `removeListener` anymore. subscription.linkLifeCycleTo(object: view)
public func linkLifeCycleTo(object: NSObject)