lazybones / com.skydoves.lazybones / Lazybones

Lazybones

class Lazybones<out T> : Serializable

Lazybones is a wrapper class having Lazy property for lifecycle aware.

Constructors

<init>

Lazybones(lifecycleOwner: LifecycleOwner, lazy: Lazy<T>)

Lazybones is a wrapper class having Lazy property for lifecycle aware.

Functions

lazy

fun lazy(): Lazy<T>

gets a lazy class.

onAny

fun onAny(receiver: (T) -> Unit): Lazybones<T>

returns a Lazybones and the receiver will be aware of On.ANY lifecycle state.

onCreate

fun onCreate(receiver: (T) -> Unit): Lazybones<T>

returns a Lazybones and the receiver will be aware of On.CREATE lifecycle state.

onDestroy

fun onDestroy(receiver: (T) -> Unit): Lazybones<T>

returns a Lazybones and the receiver will be aware of On.DESTROY lifecycle state.

onPause

fun onPause(receiver: (T) -> Unit): Lazybones<T>

returns a Lazybones and the receiver will be aware of On.PAUSE lifecycle state.

onResume

fun onResume(receiver: (T) -> Unit): Lazybones<T>

returns a Lazybones and the receiver will be aware of On.RESUME lifecycle state.

onStart

fun onStart(receiver: (T) -> Unit): Lazybones<T>

returns a Lazybones and the receiver will be aware of On.START lifecycle state.

onStop

fun onStop(receiver: (T) -> Unit): Lazybones<T>

returns a Lazybones and the receiver will be aware of On.STOP lifecycle state.

toString

fun toString(): String

value

fun value(): T

gets a value from the lazy class.