gh-pages / com.nextfaze.devfun.invoke.view / ValueSource

ValueSource

interface ValueSource<out V : Any> (source)

Used in conjunction with From or Values to provide the Invoke UI with an initial value or set of values.

Example usage from DevMenu (~line 215 in com.nextfaze.devfun.menu.controllers.Cog.kt):

@Constructable
private inner class CurrentVisibility : ValueSource<Boolean> {
    override val value get() = cogVisible
}

@DeveloperFunction
private fun setCogVisibility(@From(CurrentVisibility::class) visible: Boolean) {
    cogVisible = visible
    ...
}

The above example will render an Invoke UI with a Switch with an initial state representative of the actual state.

Properties

Name Summary
value abstract val value: V
The initial value passed to the Invoke UI dialog.