ramd

1.0.1 • Public • Published

What contains library?

Minimal standalone JS library for building TODO like web applications.

What contains library?

RAMD or Render - Add - Modify - Delete is minimal 0.65 kb library for making simple list projects. Everything is based on the "simplified virtual DOM" that is basically JavaScript Object listing the essential element properties. This Object acts like internal DB that can be stored locally or send to the server. The importance of the "virtualdom" vs DOM is not about the speed but rather ease of use and storage.

 
// simplified virtual DOM
 
var someObjectName = {
  "1531563018024-9718829aa677": {
    "element": "li",
    "text": "Hello World",
    "cssStyle": "color:red",
    "id": "",
    "className": "hello"
  },
  "1531563018029-47baba1f2315": {
    "element": "div",
    "text": "button",
    "cssStyle": "",
    "id": "",
    "className": "del"
  }
 

The Object method "1531563018024-9718829aa677" is Timestamp - Random Number. You can use the Timestamp to determine when the element was added.

What contains library?

  • $ - Selector
  • on - addEventListener
  • Render and renderOne - render all and render one element
  • Adding, modifying and deleting elements
  • localStorage for storing the virtualdom

Making the super simple TODO :

 
// Just with few lines of code you can add and delete elements
 
var el1 = {}
 
on($("#bt"), 'click', function(e) {
    add(el1, $("#todo")[0], "li", $("#tx")[0].value);
 
    on($("li"), 'dblclick', function(e) {
        del(el1, this);
    });
});

Here is the Demo of the super simple TODO:

Super simple TODO demo

More complex TODO demo that saves the data in the browser

Download & Installation

You can use direct download or:

$ npm i ramd

License

This project is licensed under the MIT License

Package Sidebar

Install

npm i ramd

Weekly Downloads

7

Version

1.0.1

License

MIT

Unpacked Size

17.5 kB

Total Files

8

Last publish

Collaborators

  • vladocar