Skip to content

Commit fa8a674

Browse files
zyphiemarkus-wa
authored andcommitted
Added prop value to PropertyEntry
1 parent 05dfc93 commit fa8a674

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sendtables/entity.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,23 @@ type PropertyEntry struct {
127127
index int
128128
entry *FlattenedPropEntry
129129
updateHandlers []PropertyUpdateHandler
130+
value PropValue
130131
}
131132

132133
// Entry returns the underlying FlattenedPropEntry.
133134
func (pe *PropertyEntry) Entry() *FlattenedPropEntry {
134135
return pe.entry
135136
}
136137

138+
// Value returns current value of the property.
139+
func (pe *PropertyEntry) Value() PropValue {
140+
return pe.value
141+
}
142+
137143
// FirePropertyUpdate triggers all registered PropertyUpdateHandler
138144
// on the PropertyEntry with the given PropValue.
139145
func (pe *PropertyEntry) FirePropertyUpdate(value PropValue) {
146+
pe.value = value
140147
for _, h := range pe.updateHandlers {
141148
if h != nil {
142149
h(value)

0 commit comments

Comments
 (0)