chamber / com.skydoves.chamber / Chamber

Chamber

object Chamber

Chamber is scoped data holder with custom scopes that are lifecycle aware.

Simplifies sharing fields and communication between Android components with custom scopes that are lifecycle aware.

Making easier to communicate and data flow with each other component like Activity, Fragment, Services, etc.

And using custom scopes that are lifecycle aware makes developers can designate scoped data holder on their taste.

Functions

checkAnnotatedChamberScope

fun checkAnnotatedChamberScope(annotation: Annotation): Boolean

checks the ScopeOwner class is annotated @ChamberScope annotation.

onDestroyObserver

fun onDestroyObserver(annotation: Annotation): Unit

clears value data and observer on internal storage.

shareLifecycle

fun <T : LifecycleOwner> shareLifecycle(scopeOwner: Any, lifecycleOwner: T): Unit

Chamber synchronizes the ChamberField that has the same scope and same key. Also pushes a lifecycleOwner to the Chamber lifecycle stack.

store

fun store(): ChamberStore

gets internal storage ChamberStore.

updateValue

fun updateValue(chamberField: ChamberField<*>): Unit

updates a new ChamberField to the caches.