stateful components now in a workable state; renamed .component macro to .compact which much better captures its meaning

This commit is contained in:
Andreas Rumpf 2017-06-20 00:14:54 +02:00
commit c86916e37d
10 changed files with 185 additions and 291 deletions

View file

@ -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

View file

@ -1,5 +1,5 @@
import vdom, karax, karaxdsl, jdict, jstrutils, components
import vdom, karax, karaxdsl, jdict, jstrutils, compact
type
Filter = enum