This file contains 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
// Bellow instructions how to run a build with BabelJs. After following them, just run in CLI: `sencha app build` or `npm run build` | |
// 1. In app.json | |
"production": { | |
"output": { | |
"framework": { | |
"enable":true //This enables split mode, app code will be splitted in 2 files: app.js and framework.js | |
} | |
} | |
}, |
This file contains 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
/** Async version of Array.prototype.reduce() | |
* await reduce(['/foo', '/bar', '/baz'], async (acc, v) => { | |
* acc[v] = await (await fetch(v)).json(); | |
* return acc; | |
* }, {}); | |
*/ | |
export async function reduce(arr, fn, val, pure) { | |
for (let i=0; i<arr.length; i++) { | |
let v = await fn(val, arr[i], i, arr); | |
if (pure!==false) val = v; |