About EmitterKit
EmitterKit is an event library in Swift that emphasizes type safety and flexibility. By using EmitterKit, developers can create, observe, and fire events in a way that’s clean, easy, and efficient.
Installation
To install EmitterKit, you can use CocoaPods or Swift Package Manager.
- CocoaPods: To add EmitterKit to your project using CocoaPods, add the following line to your Podfile: ‘pod ‘EmitterKit’.’
- Swift Package Manager: To add EmitterKit as a Swift Package Manager package dependency, add the following line to your Package.swift file: ‘.package(url: “https://github.com/aleclarson/emitter-kit.git”, from: “5.2.2”)’.
Usage
EmitterKit is a simple but powerful tool. To use it, first import the EmitterKit module in your Swift file.
import EmitterKit
With EmitterKit, you can create, observe, and fire events. Here are some examples:
Creating an Event
let event = Event<String>()
Observing an Event
let listener = event.on { message in print(message) }
Firing an Event
event.emit("Hello, world!")
Contributing
If you want to contribute to the development of EmitterKit, you are more than welcome to submit pull requests or create issues on the project’s GitHub page.
License
EmitterKit is licensed under the MIT License. This means you can use it freely in your projects as long as you include the original copyright notice and disclaimers.