Skip to content

prateekbhandarii/SingleLiveEvent

Repository files navigation

SingleLiveEvent

A demonstration of how to make global events which can be observed anywhere across the application when posted with values. The observer should be active, i.e. the Fragment/Activity in which we observe the event should have active lifecycle.

Step 1: Create an instance of SingleLiveEvent<> class.

image

Step 2:

Simply use postValue() function to setup the event.

image

Step 3:

Observe the values anywhere in the app.

image

Feel free to reach me, in sense of any issues or improvements. :) !

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages