4 ms·
Here's how I understood it... The DOM elements aren't stateless, but they will behave like they are if you update every attribute that can change in the `$upda
by guscost 9y ago
Here's how I understood it...
The DOM elements aren't stateless, but they will behave like they are if you update every attribute that can change in the `$update` function.
Really all you're doing is mutating the DOM objects themselves, but one of them is this magic `$update` function that runs every time one of that element's attributes changes I think. The framework just provides a proxy object for accessing the attributes, and every cell is extensible with custom data and functions. For some fun try overwriting `this.$update` in `$update`.
Another thing I totally missed at first is the fact that you can embed a <script> containing a variable with the `$cell` property anywhere in the page and the cell will show up in that part of the DOM, and you can do this as much as you want.
- guscost 9y agoActually, there's a better method for embedding in an element: Just put the <script> wherever you want, but include an `id` in the configuration object that matches a <div> in your page.