Blame view

src/main/kotlin/application/model/ObservableReplayState.kt 416 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
9
      val listeners: MutableList<ReplayState> = mutableListOf()
  
      var value: Boolean by Delegates.observable(
          initialValue = true,
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
  }