Eventable
public protocol Eventable: class
Create a nifty Event Emitter in Swift
-
Event Listeners
Declaration
Swift
var listeners: [Event: [(Any) -> ()]]
-
on(_:do:)
Default implementationDefault Implementation
Listens for eventName
Declaration
Swift
func on(
-
emit(_:with:)
Default implementationDefault Implementation
Emits all listeners for eventName
Declaration
Swift
func emit(
-
removeListener(from:at:)
Default implementationDefault Implementation
Removes a listener from an event
Declaration
Swift
func removeListener(