Skip to content

v0.9.0

Compare
Choose a tag to compare
@sugarmanz sugarmanz released this 17 Mar 21:58
· 90 commits to main since this release

πŸŽ‰ This release contains work from a new contributor! πŸŽ‰

Thank you, David Stone (@stabbylambda), for all your work!

Release Notes

Hooks with type parameters (#8)

Enhance DSL to adds the ability to generate Hooks with type parameters. The use case for this is when some piece of data is known only to the consumer of a library and the consumers of the taps, but not necessarily the library itself. As an example:

class FooHooks<T> : Hooks() {
    open val beforeCalc = syncHook<(T) -> Unit>()
}

data class Foo<T>(val t: T)  {
    public val hooks = FooHooksImpl<T>()

    fun calc() {
        hooks.beforeCalc.call(t)
        // ...
    }
}

fun runCalcsWithLog() {
    val f = Foo<String>("hi")
    f.hooks.beforeCalc.tap("hi") { x -> println(x) }
}

πŸš€ Enhancement

πŸ› Bug Fix

πŸ“ Documentation

Authors: 2