0.0.9 • Published 1 year ago

ds-element-tree v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

A simple TypeScript library for easily creating an interactive UI. It's goal is to be as close to vanilla JS/TS as possible. It is also more focused on making it easier to make desktop apps with tools like Electron.

It requires no bundler, transpiler, or CLI. It can be used with TypeScript or vanilla JS.

You can make stateful components as well as stateless elements. Stateless elements can still be updated with cascade. Another feature is loading CSS modules and auto adding them to the page.

Check out the wiki and the electron folder to see all working examples.

Here is a simple clock example:

import { ElementTree } from "ElementTree.js";

(() => {
 const cascadeProps = {
  time: new Date().toLocaleTimeString(),
 };

 const [cascade] = ElementTree.cascade(cascadeProps);

 ElementTree.bloomRoot([
  {
   type: "p",
   cascade: {
    origin: cascadeProps,
    receiver: (elm: HTMLElement, props: typeof cascadeProps) => {
     elm.innerText = props.time;
    },
   },
   text : new Date().toLocaleTimeString()
  },
 ]);

 setInterval(() => {
  cascadeProps.time = new Date().toLocaleTimeString();
  cascade();
 }, 1000);
})();
0.0.9

1 year ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.42

2 years ago

0.0.41

2 years ago

0.0.4

2 years ago

0.0.31

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago