This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(Node, Element, HTMLCollection, Array) { | |
/** | |
* Wrap addEventListener to handle multiple event types and be chainable. | |
* @param {string} types - Space-separated event types. | |
* @param {function} listener | |
* @param {boolean} useCapture | |
* @returns {Node} | |
* | |
* @example | |
* document.querySelector('a') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {object} scope - Object that all bound data will be attached to. | |
*/ | |
function twoWayBind(scope) { | |
// a list of all bindings used in the DOM | |
// @example | |
// { 'person.name': [<input type="text" data-bind="person.name"/>] } | |
var bindings = {}; | |
// each bindings old value to be compared for changes |