Eventable

public protocol Eventable: class

Create a nifty Event Emitter in Swift

  • Event Listeners

    Declaration

    Swift

    var listeners: [Event: [(Any) -> ()]]
  • on(_:do:) Default implementation

    Default Implementation

    Listens for eventName

    Declaration

    Swift

    func on(
  • emit(_:with:) Default implementation

    Default Implementation

    Emits all listeners for eventName

    Declaration

    Swift

    func emit(
  • removeListener(from:at:) Default implementation

    Default Implementation

    Removes a listener from an event

    Declaration

    Swift

    func removeListener(