Callbacker2

open class Callbacker2<T0, T1>

Organize multiple callbacks for a function that accepts two parameters. This is a convenience class for this common case. For larger numbers of parameters you can always place them in an object or a list and use the single-parameter callbacker

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun add(fn: (T0, T1) -> Unit): Int

adds a callback into this object. The returned key is used to remove or replace the callback

fun add(key: Int, fn: (T0, T1) -> Unit): Int

adds a callback into this object by key. If a callback of this key exists, it will be replaced.

Link copied to clipboard
fun invoke(param0: T0, param1: T1)
Link copied to clipboard
fun remove(key: Int): (T0, T1) -> Unit?