Types
AnyProperty[T] = concept avar v a[] is T v[] = T a.changed is Event[void] `{}`(a) is T `{}=`(v, T)
- Source Edit
CustomProperty[T] = object get*: proc (): T set*: proc (v: T) changed*: Event[void]
- Source Edit
Procs
proc `=copy`[T](p: var CustomProperty[T]; v: CustomProperty[T]) {.error.}
- Source Edit
proc `[]`[T](p: CustomProperty[T]): T {.inline.}
- Source Edit
proc `[]=`[T](p: CustomProperty[T]; v: T) {.inline.}
- Source Edit
proc unsafeVal[T](p: CustomProperty[T]): T {.inline.}
- note: can't get var T due to nature of CustomProperty Source Edit
proc unsafeVal=[T](p: CustomProperty[T]; v: T) {.inline.}
- same as val=, but always call setter and does not emit p.changed Source Edit
proc val[T](p: CustomProperty[T]): T {.inline.}
- Source Edit
proc val=[T](p: CustomProperty[T]; v: T)
- note: p.changed will not be emitted if new value is same as previous value Source Edit
proc `{}`[T](p: CustomProperty[T]): T {.inline.}
- Source Edit