UNPKG

mutant

Version:

Create observables and map them to DOM elements. Massively inspired by hyperscript and observ-*. No virtual dom, just direct observable bindings. Unnecessary garbage collection is avoided by using mutable objects instead of blasting immutable junk all ove

17 lines (14 loc) 353 B
module.exports = function (target, lookup, checkUpdated) { target.keys = function () { checkUpdated && checkUpdated() return Object.keys(lookup) } target.get = function (key) { checkUpdated && checkUpdated() return lookup[key] } target.has = function (key) { checkUpdated && checkUpdated() return key in lookup } }