ICE Out; Abolish ICE
This is a basic implementation of the game Tetris, but it's missing a few things intentionally and they're left as further exploration for the reader.
| /** | |
| * Create element with attributes | |
| * | |
| * <input type="number" min="0" max="99" name="number" id="number" class="number-input" disabled/> | |
| */ | |
| // native | |
| var input = document.createElement('input'); | |
| input.type = "number"; | |
| input.min = 0; |
| (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') |
| { | |
| "presets": [ | |
| [ | |
| "@babel/preset-env", | |
| { | |
| "targets": { | |
| "node": "current" | |
| } | |
| } | |
| ], |
| /** | |
| * @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 |
| { | |
| "presets": [ | |
| [ | |
| "@babel/preset-env", | |
| { | |
| "targets": { | |
| "node": "current" | |
| } | |
| } | |
| ], |