Pro.ObservableMutable

trait ObservableMutable[A] extends Pro.Observable[A] with Pro.Mutable[A]

Read/write/listenTo Property`

The usual implementation looks like:

class Foo:
  val name_*          : Pro.OM[String] = String.Pro.OM("")
  def name            : String         = name_*()
  def name_=(v:String): Unit           = name_*() = v
  val bar_*           : Int.Pro.OM     = Int.Pro.OM(0)
  def bar             : Int            = value_*()
  def bar_=(v:Int)    : Unit           = value_*() = v
Source
__.scala
trait Pro.Mutable[A]
trait Pro[A]
class java.lang.Object
trait scala.Matchable
class Any

Def

def apply(): A

Get value

Get value

Returns property value

   val pro: Pro.M[String] = Pro.M[String]("abc")

   val v1 = pro.apply() // Regular call
   val v2 = pro()       // Scala "syntactic sugar" call
Inherited from
Pro
Source
__.scala
def onChange[U](l: () => U): Event.Control

On change subscription

On change subscription

Adds given function as listener to property change events

   val pro = String.Pro.OM("foo")

   // event subscription
   pro.onChange(() => "Change Detected".tp)

   // library based event subscription
   pro.onValueChangeWithOld((v, old) => "Value changed from " + old + " to " + v tp()))

   pro() = "bar"

   // Output
   Value changed from foo to bar
   Change Detected
Inherited from
Observable
Source
__.scala
def update(v: A): Unit

Updates value

Updates value

Updates property value

   val pro: Pro.M[String] = Pro.M[String]("")

   pro.update("abc") // Regular call

   pro() = "abc"     // Scala "syntactic sugar" call
Inherited from
Mutable
Source
__.scala

Extension

@scala.annotation.targetName("mutableMap_View")
def mutableMap_^[A](m: A => B, r: B => A): Pro.ObservableMutable[B]
Source
__.scala
@scala.annotation.targetName("mutableMap_View")
Source
__.scala