All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.taig.android.monix.EventSink.scala Maven / Gradle / Ivy

There is a newer version: 0.8.2
Show newest version
package io.taig.android.monix

class EventSink[T] {
  private val listeners = collection.mutable.ListBuffer.empty[T ⇒ Unit]

  def register(f: T ⇒ Unit): Unit = listeners += f

  def unregister(f: T ⇒ Unit): Unit = listeners -= f

  def notify(event: T): Unit = listeners.foreach(_.apply(event))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy