stateful components now work

This commit is contained in:
Andreas Rumpf 2017-04-19 11:17:00 +02:00
commit be4159fc11
2 changed files with 55 additions and 40 deletions

View file

@ -6,7 +6,7 @@ var
proc carousel*(key: VKey): VNode {.component.} =
state:
var counter = 0
var counter: int = 0
proc next(ev: Event; n: VNode) =
counter = (counter + 1) mod images.len