mercury
Version:
A truly modular frontend framework
42 lines (26 loc) • 1.03 kB
Markdown
Auto generated from [observ-varhash](https://github.com/nrw/observ-varhash) package (version 1.0.4).
An object with observable key value pairs that can be added and removed
An `ObservVarhash` is a version of `observ-struct` that allows
adding and removing keys. Mutation of an observable element in
the hash will cause the `ObservVarhash` to emit a new changed
plain javascript object.
```js
var ObservVarhash = require("observ-varhash")
var Observ = require("observ")
var people = ObservVarhash({jack: 'Jack'}, function create (obj, key) {
return Observ(obj)
})
people.put('diane', 'Diane')
console.log(people())
// plain javascript object {jack: 'Jack', diane: 'Diane'}
```
`npm install observ-varhash`
- Nicholas Westlake
API based on [`observ-struct`](https://github.com/Raynos/observ-struct)
[]: https://secure.travis-ci.org/nrw/observ-varhash.png
[]: https://travis-ci.org/nrw/observ-varhash