stateful components now in a workable state; renamed .component macro to .compact which much better captures its meaning
This commit is contained in:
parent
4801b8d8c1
commit
c86916e37d
10 changed files with 185 additions and 291 deletions
|
|
@ -51,13 +51,13 @@ proc render(x: VComponent): VNode =
|
|||
|
||||
var gid: int
|
||||
|
||||
proc changed(c: VComponent): bool =
|
||||
let x = Carousel(c)
|
||||
result = x.change
|
||||
|
||||
proc carousel(): Carousel =
|
||||
result = Carousel(kind: VNodeKind.component, key: -1)
|
||||
result.render = render
|
||||
result = newComponent(Carousel, render, changed)
|
||||
result.list = images
|
||||
result.changed = proc (c: VComponent): bool =
|
||||
let x = Carousel(c)
|
||||
result = x.change
|
||||
result.cntdown = ticksUntilChange
|
||||
result.myid = gid
|
||||
inc gid
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue