
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
com.github.hadilq.liveevent:liveevent
Advanced tools
This library holds a class to handle single live events in Android MVVM architectural pattern. This class is extended form LiveData class, from `androidx.lifecycle:lifecycle-extensions` library, to propagate the data as an event, which means it emits data just once.
This library holds a class to handle single live events in Android MVVM architectural pattern. This class is extended
form LiveData class, from androidx.lifecycle:lifecycle-extensions library, to propagate the data as an event,
which means it emits data just once, not after configuration changes again. Note that event will only be sent
to active observers, any observers that started observing after the emit won't be notified of the event.
This source has a sample app where you can find LiveEventViewModel in it, in which the LiveEvent class is used as
follows.
class LiveEventViewModel : ViewModel() {
private val clickedState = LiveEvent<String>()
val state: LiveData<String> = clickedState
fun clicked() {
clickedState.value = ...
}
}
There are two behaviours of LiveEvent in-demand. First one is LiveEventConfig.Normal,
where supports multi-observers on all cases the same. This config was originally implemented for
this library so it's the default config, but if you want to be explicit, you can pass it to the
constructor of LiveEvent.
The second config is LiveEventConfig.PreferFirstObserver. This one is useful when you want to
emit an event in the init method of ViewModel and expect the first observer receive it.
To set it up you need to pass it to the constructor
private val clickedState = LiveEvent<String>(config = LiveEventConfig.PreferFirstObserver)
Download via gradle
implementation "com.github.hadilq:live-event:$libVersion"
where you can find the libVersion in the Releases page of this repository.
Snapshots of the development version are available in Sonatype's snapshots repository.
Just create your branch from the master branch, change it, write additional tests, satisfy all tests, create your pull request, thank you, you're awesome.
FAQs
This library holds a class to handle single live events in Android MVVM architectural pattern. This class is extended form LiveData class, from `androidx.lifecycle:lifecycle-extensions` library, to propagate the data as an event, which means it emits data just once.
We found that com.github.hadilq.liveevent:liveevent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.