observify-varhash
This is just a fork of observify, but uses observ-varhash for objects instead of observ-struct so that keys can be added and removed.
Converts JS objects into their observable equivalents using observ, observ-array and observ-varhash. Designed for use with mercury
installation
npm install observify-varhash
usage
var observify = var data =
is equivalent to doing:
var array = var varhash = var value = var data =
blacklisted properties
observ-varhash
has a blacklist of property names that cannot be used as keys (as they clash with javascript reserved words).
You can pass an options object with a autoRename
property to tell observify to rename these properties.
var observify = var data = console
This would print:
$name:"I'm bad, I'm bad, you know it" comment:"I am OK"
If autoRename
is true it will default to $
.