Skip to content

Commit

Permalink
change mikado proxy to strict data-driven
Browse files Browse the repository at this point in the history
  • Loading branch information
ts-thomas committed Jan 21, 2024
1 parent 9f215e2 commit a86678c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
9 changes: 4 additions & 5 deletions test/mikado-proxy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@ <h1>Benchmark: mikado-proxy-0.8.117 (non-keyed)</h1><hr>
import template from "./template/template.js";
import Mikado from "./dist/mikado.bundle.module.min.js";

const data = new Mikado.Array();

// each test gets new random data

const mikado = new Mikado(template, {
observe: store(new Mikado.Array()),
observe: data,
mount: root,
recycle: true,
cache: true,
pool: 100
});

suite["mikado"] = function(items){

mikado.render(items);
};
suite["mikado"] = data.set.bind(data);

</script>
</body>
Expand Down
10 changes: 9 additions & 1 deletion test/mikado-proxy/internal.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@ <h1>Benchmark: mikado-proxy-0.8.117 (internal data)</h1><hr>
// each test gets new random data

const mikado = new Mikado(template, {

// the internal mode don't apply de-referencing to the data
// push a reference of the array to the benchmark via: store(arr)
// or you can also get the array reference by: arr = store()

observe: store(new Mikado.Array()),
mount: root,
cache: true,
pool: 100
});

suite["mikado"] = function(items){};
// nothing required, since all changes are already applied by
// reactive approach during the "start" phase (which is also covered by the benchmark)

suite["mikado"] = function(){};

</script>
</body>
Expand Down
9 changes: 4 additions & 5 deletions test/mikado-proxy/keyed.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,18 @@ <h1>Benchmark: mikado-proxy-0.8.117 (keyed)</h1><hr>
import template from "./template/keyed.js";
import Mikado from "./dist/mikado.bundle.module.min.js";

const data = new Mikado.Array();

// each test gets new random data

const mikado = new Mikado(template, {
observe: store(new Mikado.Array()),
observe: data,
mount: root,
cache: true,
pool: 100
});

suite["mikado"] = function(items){

mikado.render(items);
};
suite["mikado"] = data.set.bind(data);

</script>
</body>
Expand Down

0 comments on commit a86678c

Please sign in to comment.