intercellular / cell

A self-driving web app framework
https://www.celljs.org
MIT License
1.5k stars 93 forks source link

Genotype preservation #145

Closed gliechtenstein closed 7 years ago

gliechtenstein commented 7 years ago

$node.$snapshot() returns its genotype. Used for serializing/deserializing a cell.

Example:

c = {
  $cell: true,
  $type: "div",
  class: "container",
  $init: function() {
    for(var i=0; i<5; i++) {
      this.$components.push({$type: "div", class: "row", $text: i})
    }
  },
  $components: []
}

var gene = document.body.querySelector(".container").$snapshot();
// 'gene' contains the contents of the variable c;
coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.7%) to 83.707% when pulling 746e39d2f5a7fd33e1a6d7628a901058fbc0269c on genotype-preservation into 01ab40289b2e3586e9c1f7954835267f09d858a1 on develop.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.8%) to 83.806% when pulling dcbc5abd2bb563233ec3171735b8b7a3766c9788 on genotype-preservation into 01ab40289b2e3586e9c1f7954835267f09d858a1 on develop.