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

19 lines (16 loc) 274 B
module.exports = Send function Send (fn, data, opts) { return { fn: fn, data: data, opts: opts, event: null, handleEvent: handleEvent } } function handleEvent (e) { e.stopPropagation() e.preventDefault() this.event = e this.fn(this.data) }