0.3.3 • Published 7 years ago

basic-virtual-dom v0.3.3

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Very basic virtual-dom implementation

Build Status Coverage Status dependencies alpha npm version

Features

Support of following patch types:

  • PATCH_CREATE
  • PATCH_REMOVE
  • PATCH_REORDER
  • PATCH_PROPS
  • Small amount of diffing iterations
  • Referal based patches without identifiers
  • No iterations over the virtual or dom tree when applying patches

Seems like it has not so bad memory usage and rendering performance

Example

Example

Simple day countdown example

/** @jsx h */

import {h, patch, diff} from '../../';

var initialDom = (
  <div>
    <div><h3>Counter</h3></div>
  </div>
);

document.getElementById('application')
  .appendChild(initialDom.render());

setInterval(function() {
  var cd = countDown();
  var countDownDom = (
    <div>
      <div><h3>Day Countdown</h3></div>
      <div className="clock">
        <strong>{cd.h}</strong> :&nbsp;
        <strong>{cd.m}</strong> :&nbsp;
        <strong>{cd.s}</strong>
      </div>
    </div>
  );

  var diffs = diff(initialDom, countDownDom);
  patch(initialDom, diffs);

}, 1000);

TODO

  • test browser support

License

MIT (c) Svetlana Linuxenko

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.0.1

7 years ago