0.14.0 • Published 6 years ago

domma v0.14.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Overview

How to Install

npm install --save domma

Get Started

import Domma from "domma";

// Get your own static document
const staticDocument = document.implementation.createHTMLDocument('');

// Create Domma instance
const domma = new Domma();

// Connect your static document to domma
domma.connectStaticDocument(staticDocument);

// Compose a "live" clone of your document 
domma.composeLiveDocument();

// Apply any dynamic changes that should not be synced with static DOM
const liveDocument = domma.getLiveDocument();
liveDocument.body.setAttribute('id', 'dynamic-id');

// Apply changes that should be synced with static DOM
domma.conductTransaction((liveDOM) => {
  liveDOM.body.innerHTML = 'hello world';
}).then(() => {
  const staticDOM = domma.getStaticDocument();
  const body = staticDOM.body;
  
  // Dynamic changes are not synced
  const id = body.getAttribute('id'); // id => undefined
  
  // Transaction changes are synced
  const html = body.innerHTML; // html => 'hello world'
});

Contributing to Domma

Contributions are always welcome. Before contributing please read the code of conduct & search the issue tracker (your issue may have already been discussed or fixed).

To contribute, follow next steps:

  • Fork Domma
  • Commit your changes
  • Open a Pull Request.

Feature Requests

Feature requests should be submitted in the issue tracker, with a description of the expected behavior & use case, where they'll remain closed until sufficient interest (e.g. :+1: reactions). Before submitting a feature request, please search for similar ones in the closed issues.

License

Released under the MIT License

0.14.0

6 years ago

0.13.1

6 years ago

0.13.0

6 years ago

0.12.0

6 years ago

0.11.0

6 years ago

0.10.1

6 years ago

0.10.0

6 years ago

0.9.14

6 years ago

0.9.13

6 years ago

0.9.11

6 years ago

0.9.10

6 years ago

0.9.9

6 years ago

0.9.8

6 years ago

0.9.7

6 years ago

0.9.6

6 years ago

0.9.5

6 years ago

0.9.4

6 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago