This repository has been archived by the owner on Mar 25, 2023. It is now read-only.
v0.2.0-alpha
Pre-release
Pre-release
·
14 commits
to main
since this release
Welcome to tntjs v0.2.0 Alpha release.
This version we use vdom and make tntjs be faster!
This version are rewritten version
How to use?
To make a tntjs app, you should:
const app = new TNT.TNTApp()
.useData({
x: 114514,
foo: [],
bar: 5
})
.useComputed({
sum: function () {
var sum = 0;
data.foo.forEach(function (v) { return (sum += v); });
return sum;
}
})
.useEffect(function () {
console.log("Sum changed: ".concat(data.sum));
})
.onMounted(function (app) {
console.timeEnd("mount");
console.log("App mounted!");
})
.mount(document.getElementById("root"));
data.foo = [233];
Use TNT.TNTApp
to new a tntjs app, and use useData
to set variable and use mount
to set the app node
What change than tntjs Alpha 0.1?
The rewritten version In the new version, we use virtual dom to increase the speed of tntjs several times. It only takes 200ms to render 10,000 nodes, and the user api is more user-friendly.