Swiftpack.co - BinaryBirds/hook-kit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by BinaryBirds.
BinaryBirds/hook-kit 1.0.0
Generic event hook functions and invocation for Swift.
⭐️ 2
🕓 3 years ago
.package(url: "https://github.com/BinaryBirds/hook-kit.git", from: "1.0.0")

HookKit

Generic event hook functions and invocation for Swift.

Install

Add the repository as a dependency:

.package(url: "https://github.com/binarybirds/hook-kit", from: "1.0.0"),

Add HookKit to the target dependencies:

.product(name: "HookKit", package: "hook-kit"),

Update the packages and you are ready to use HookKit.

Basic usage

let hooks = HookStorage()
hooks.register("test") { _ in "Hello world" }
let result: String? = hooks.invoke("test")
print(result) /// Optional("Hello world")

To learn more about hook functions, please read my article.

GitHub

link
Stars: 2
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Initial release
3 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics