This is the reference point. All the other options are based off this.
|-- app
| |-- controllers
| | |-- admin
// Implementation in ES6 | |
function pagination(c, m) { | |
var current = c, | |
last = m, | |
delta = 2, | |
left = current - delta, | |
right = current + delta + 1, | |
range = [], | |
rangeWithDots = [], | |
l; |
Picking the right architecture = Picking the right battles + Managing trade-offs
// Copyright 2018 Gordon Brander | |
// Released under MIT License https://opensource.org/licenses/MIT | |
const closest = (el, selector) => | |
el.closest ? el.closest(selector) : null; | |
/** | |
* Delegate event handling to a parent element. | |
* @arg {Element} el - the parent element that we will be delegating handling to. | |
* @arg {string} selector - CSS selector of elements that should receive events. |