Skip to content

Instantly share code, notes, and snippets.

View aescarcha's full-sized avatar

Álvaro Escarcha aescarcha

View GitHub Profile
@martinabrahams
martinabrahams / distinct.ts
Created September 27, 2017 02:37
Get distinct items in array in TypeScript - source https://stackoverflow.com/a/45886147/6732882
Array.from(new Set(yourArray.map((item: any) => item.id)))
@aescarcha
aescarcha / nodeAsyncTest.js
Created September 25, 2018 07:03
Javascript async / await resolving promises at the same time test
// Simple gist to test parallel promise resolution when using async / await
function promiseWait(time) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
}, time);
});
}