Skip to content

Commit

Permalink
refactor(examples): minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Feb 27, 2018
1 parent 8a070ff commit 70720a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/cellular-automata/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const presets: DropDownOption[] = [
["000111111000001111", "maze #2"],
["000001111111111110", "dots"],
["000101111000001111", "growth"],
["000001011001011111", "organic"],
["000001111000011111", "organic"],
["000010011000011111", "angular"],
];

Expand Down
9 changes: 5 additions & 4 deletions examples/hdom-benchmark/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const hex6 = tx.hex(6);
*
* @param id
*/
const box = (id: number) => [
const box = (index: number, id: number) => [
(id & 1) ? "div" : "box",
{ style: { background: "#" + hex6((id & 0x1ff) << 15 | id << 10 | id) } },
{ key: index, style: { background: "#" + hex6((id & 0x1ff) << 15 | id << 10 | id) } },
hex4(id & 0xffff)
];

Expand Down Expand Up @@ -99,8 +99,9 @@ const app = () => {
let j = (++i) & 0x1ff;
return ["div",
["div#stats", fps, menu],
tx.transduce(tx.map(box), tx.push(), <any>["grid"], tx.range(j, j + num))];
["grid", ...tx.iterator(tx.mapIndexed(box), tx.range(j, j + num))]
];
};
};

start(document.getElementById("app"), app());
start(document.getElementById("app"), app(), false);

0 comments on commit 70720a3

Please sign in to comment.