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
// Variable Assignment | |
const getData = async function () { | |
try { | |
const data = await fakeAsyncCall(); | |
console.log(data); // foo data | |
} catch (error) { | |
console.error(`Uh oh: ${error}`); | |
} | |
}; |
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 function getData() { | |
try { | |
const data = await fakeAsyncCall(); | |
console.log(data); // foo data | |
} catch (error) { | |
console.error(`Uh oh: ${error}`); | |
} | |
} |
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
function fakeAsyncCall(resultText = 'foo data') { | |
return new Promise((resolve, reject) => { | |
if (typeof resultText !== 'string') { | |
return reject('result text should equal string'); | |
} | |
setTimeout(() => { resolve(resultText) }, 1000); | |
}); | |
} | |
async function getData() { |
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 function getData() { | |
const f1 = await fakeAsyncCall(); | |
const f2 = await fakeAsyncCall(); | |
const f3 = await fakeAsyncCall(); | |
const f4 = await fakeAsyncCall(); | |
console.log(f1, f2, f3, f4); // 'foo data' x 4 | |
} |
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
function fakeAsyncCall(resultText = 'foo data') { | |
return new Promise((resolve) => { | |
setTimeout(() => resolve(resultText), 1000); | |
}); | |
} | |
function getData() { | |
fakeAsyncCall() | |
.then(fakeAsyncCall) | |
.then(fakeAsyncCall) |
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
function equal(objA, objB) { | |
const sObjA = JSON.stringify(objA); | |
const sObjB = JSON.stringify(objB); | |
return (sObjA === sObjB); | |
} | |
class AppState { | |
constructor(state = {}, components = []) { | |
this.state = state; | |
this.components = components; |
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
# Steps taken from here: https://sethvargo.com/replace-icons-osx/ | |
ls /Applications/Atom.app/Contents/Resources | grep .icns | |
cp ~/.custom-icons/atom.icns /Applications/Atom.app/Contents/Resources/atom.icns | |
touch /Applications/Atom.app | |
sudo killall Finder && sudo killall Finder |
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
{ | |
"name": "", | |
"version": "1.0.0", | |
"description": "", | |
"main": "", | |
"scripts": { | |
"start": "webpack --config webpack.config.js", | |
"build": "webpack -p --config webpack.config.js" | |
}, | |
"keywords": [], |
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
([function(e, t, n) { | |
"use strict"; | |
function r() { | |
console.log("foo called") | |
} | |
// NO MORE BAR :) | |
t.a = r | |
}, function(e, t, n) { | |
"use strict"; |
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
/* 0 */ | |
/***/ (function(module, __webpack_exports__, __webpack_require__) { | |
"use strict"; | |
/* harmony export (immutable) */ __webpack_exports__["a"] = foo; | |
/* unused harmony export bar */ | |
function foo() { | |
console.log('foo called'); | |
} |