Hook represents a “pluggable” point in a software model. They provide a mechanism for “tapping” into such points to get updates, or apply additional functionality to some typed object.
Variety of built in hook types
|Basic||Executes the taps with no return value|
|Waterfall||“Reduce” the result through all the taps|
|Bail||Retrieve the result of the first tap that handles the calling value|
|Loop||Execute taps until no taps request the loop be restarted|
At Intuit, we’re big fans of tapable, and plugin architecture. This package is the Swift companion to the Kotlin hooks. These are packages we use to enable extensible software, keeping extensions isolated to those that need them, avoiding bloat in primary projects.
Swift Package Manager
Install with Swift Package Manager by adding a reference to your
let package = Package( ... dependencies: [ .package(url: "https://github.com/intuit/swift-hooks.git", from: "0.0.1") ] )
Install with CocoaPods by adding an entry to your
Podfile, and then running
Make sure to read our code of conduct.
This is a Swift only package, so it can be built easily from the command line:
Running tests in parallel is preffered as it completes much faster:
swift test --parallel
This project uses SwiftLint for linting, and follows the default conventions:
swift run swiftlint
This project is also set up for SwiftFormat to automatically format code:
swift run swiftformat Sources