New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

virtual-doml

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

virtual-doml

A simple virtual dom solution

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-90%
Maintainers
1
Weekly downloads
 
Created
Source

Virtual-Dom

Build Status Coverage Status npm

A reconstruction version of simple-virtual-dom

Feature

  • Use ES6&ES7 to reconstruct the code.
    • remove redundancy codes.
    • more readable.
  • Add test of 'Root reordering and child replacing'.
  • Add test of 'Root reordering,and children adding and removing'.
  • The size of dist file has been compressed by 38%.

Install

npm:

$ npm install virtual-doml --save-dev

or script:

<script src='/dist/virtualDom.js'></script>

or you can use reference project simple-virtual-dom.

Usage

var vdom=require('virtual-doml');
var el=vdom.el;
var diff=vdom.diff;

var tree=el('div',{'id':'container'},[
    el('p',{name:'lowesyang'},['Hello vdom']),
    el('ul',[el('li',['item1']),el('li',['item2'])])
])

var newTree=el('div',{'id':'container'},[
    el('h1',{style:'color:red'},['Hello LowesYang']),
    el('p',{name:'lowesyang'},['Hello vdom']),
    el('ul',[el('li',['item2'])])
])

var patches=diff(tree,newTree);
var root=tree.render();
document.querySelector('#demo').appendChild(root);
setTimeout(()=>{
    patches.apply(root);
},2000)

License

MIT

Keywords

FAQs

Package last updated on 14 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc