allow newRSeq[T]() as construction
This commit is contained in:
parent
2c3e8be9b4
commit
741ff50cae
1 changed files with 2 additions and 2 deletions
|
|
@ -164,7 +164,7 @@ proc newReactive*[T](x: T): Reactive[T] =
|
||||||
proc rstr*(x: cstring): RString =
|
proc rstr*(x: cstring): RString =
|
||||||
result = RString(value: x)
|
result = RString(value: x)
|
||||||
|
|
||||||
proc newRSeq*[T](len: int): RSeq[T] =
|
proc newRSeq*[T](len: int = 0): RSeq[T] =
|
||||||
result = RSeq[T](s: newSeq[T](len), L: newReactive[int](0))
|
result = RSeq[T](s: newSeq[T](len), L: newReactive[int](0))
|
||||||
|
|
||||||
proc newRSeq*[T](data: seq[T]): RSeq[T] =
|
proc newRSeq*[T](data: seq[T]): RSeq[T] =
|
||||||
|
|
@ -354,7 +354,7 @@ template vmap*(x: RSeq; elem, f: untyped): VNode =
|
||||||
tmp
|
tmp
|
||||||
|
|
||||||
template vmapIt*(x: RSeq; elem, call: untyped): VNode =
|
template vmapIt*(x: RSeq; elem, call: untyped): VNode =
|
||||||
var it {.inject}: type(x[0])
|
var it {.inject.}: type(x[0])
|
||||||
let tmp = buildHtml(elem):
|
let tmp = buildHtml(elem):
|
||||||
for i in 0..<len(x):
|
for i in 0..<len(x):
|
||||||
it = x[i]
|
it = x[i]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue