-
Dispatches a
Dispatchable
itemDeclaration
Swift
@discardableResult func dispatch(_ dispatchable: Dispatchable) -> Promise<Void>
Parameters
dispatchable
the dispatchable to dispatch
Return Value
a promise that is resolved when the dispatchable is handled by the store
-
Adds a listener to the store. A listener is basically a closure that is invoked every time the Store’s state changes
Declaration
Swift
func addListener(_ listener: @escaping StoreListener) -> StoreUnsubscribe
Parameters
listener
the listener closure
Return Value
a closure that can be used to remove the listener