Blame view

src/main/kotlin/application/model/ObservableReplayState.kt 417 Bytes
9e952e84e   lsagona   add message clust...
1
2
3
  package application.model
  
  import kotlin.properties.Delegates
3b26be8f9   lsagona   controle the time...
4
  class ObservableReplayState {
9e952e84e   lsagona   add message clust...
5

3b26be8f9   lsagona   controle the time...
6
7
8
      val listeners: MutableList<ReplayState> = mutableListOf()
  
      var value: Boolean by Delegates.observable(
dd1ce7fe8   lsagona   add button to swi...
9
          initialValue = false,
9e952e84e   lsagona   add message clust...
10
11
12
13
14
15
16
17
          onChange = { _, _, new ->
              run {
                  listeners.forEach {
                      it.onValueChanged(new)
                  }
              }
          }
      )
3b26be8f9   lsagona   controle the time...
18

9e952e84e   lsagona   add message clust...
19
  }