Re:Cell – A self-driving web app framework
by guscost on Friday June 16, 2017 @11:10PM
(#14574075)
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.
Re:Cell – A self-driving web app framework
by guscost on Saturday June 17, 2017 @09:05AM
(#14575729)
Actually, 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.
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.