sourceOr

inline fun <T : Any> Mosaic.sourceOr(qualifier: String? = null): T?(source)

Retrieves a dependency from the canvas using reified type parameters, returning null if not found.

Return

The dependency instance or null if not found

Parameters

qualifier

Optional qualifier to distinguish between multiple instances of the same type

Type Parameters

T

The type of the dependency to retrieve


fun <T : Any> Mosaic.sourceOr(key: CanvasKey<T>): T?(source)

Retrieves a dependency from the canvas using a CanvasKey, returning null if not found.

Return

The dependency instance or null if not found

Parameters

key

The canvas key identifying the dependency

Type Parameters

T

The type of the dependency to retrieve