These are chat archives for ramda/ramda

24th
Sep 2016
Transforms recursion ⟹ loop
Markus Pfundstein
@MarkusPfundstein
Sep 24 2016 10:02
@xgrommx this is really cool :O
one question though. how does if(this.left) yield * this.left; invoke a new traversal
because of the […a] ?
Denis Stoyanov
@xgrommx
Sep 24 2016 10:03
@MarkusPfundstein yield * freeze state until nested generator will not to be completed
Markus Pfundstein
@MarkusPfundstein
Sep 24 2016 10:04
but this.left is just a class instance
how does it now to invoke * traverse
instead of
 * traverse() {
    if(this.left) yield * this.left.traverse();
because of the […a] I guess… ?
Denis Stoyanov
@xgrommx
Sep 24 2016 10:10

@MarkusPfundstein magic here =)

  [Symbol.iterator]() {
    return this.traverse();
  }

read about Symbol