I hereby claim:
- I am benmccormick on github.
- I am ben_mccormick (https://keybase.io/ben_mccormick) on keybase.
- I have a public key ASA-PhwIqziP2g1Ycexv29-bEBSVn-qNjgtQRZ0ZLDjIbgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
module.exports = function (file, api) { | |
const j = api.jscodeshift; | |
const buildDecoratorPropertiesFromCurrentObject = currentObj => { | |
let decoratorProps = []; | |
currentObj.properties.forEach(prop => { | |
if (prop.value.type === 'CallExpression' && prop.value.callee.name === 'computed') { | |
prop.kind = 'get'; | |
let fnBody = prop.value.arguments[0]; |
bootstrap -css | |
tensorflow - python | |
react -js | |
vue -js | |
d3 - js | |
react-native -js | |
angular.js - js | |
animate.css - css | |
jquery - js | |
laravel - php |
/* takes a list of params in the format | |
[{ | |
key: 'foo' | |
value: 'bar' | |
}] | |
or an object with key-value params | |
{ | |
foo: 'bar' | |
} | |
} |
let arr = [1, 2, 3]; | |
function log(item) { | |
console.log(item); | |
} | |
//forEach performs an action on each item | |
//in an array | |
arr.forEach(log); //logs 1 2 3 in order |
async function showMessageFromServer() { | |
let data = await fetch('/get/data.json'); | |
let message = data.json().message; | |
alert(message); | |
} |
//Promises take a function that receives callbacks that can be run when an operation completes | |
let delay5Seconds = new Promise(function(resolve, reject) { | |
setTimeout(resolve, 5000); | |
}); | |
//You can respond to the results of a successfully resolved Promise using the `then` function | |
delay5Seconds.then(function() { | |
console.log('This gets logged 5 seconds later') | |
}); |
//fetch makes an HTTP request and returns a promise that resolves | |
//when the file is loaded | |
let p1 = fetch('/data/file1.json'); | |
let p2 = fetch('/data/file2.json'); | |
let p3 = fetch('/data/file3.json'); | |
Promise.all([p1,p2,p3]).then(function(values) { | |
//values contains the responses from each of the promises | |
let [response1, response2, response3] = values; |
//Backbone.Model's save function is a function that takes callbacks | |
//for successful or failed saves. | |
//Normal usage | |
let model = new Backbone.Model(); | |
model.save(null, { | |
success: function() { | |
alert('saved'); |
try { | |
fetch('/some/data').then(function() { | |
throw 'error'; | |
}) | |
} catch(e) { | |
//this code won't be executed | |
console.log('Exception Caught') | |
} |