Skip to content

Instantly share code, notes, and snippets.

View anna-llorens's full-sized avatar
😀

Anna Llorens anna-llorens

😀
View GitHub Profile
@anna-llorens
anna-llorens / useOrderComponents.tsx
Last active December 17, 2022 12:45
Easily rearange sections using a Hook POC
// Types
enum DefaultSectionOrder {
Feedback,
Header,
}
enum variant1 {
Header,
Feedback,
}
@anna-llorens
anna-llorens / async-foreach.js
Last active June 8, 2022 02:35 — forked from Atinux/async-foreach.js
JavaScript: async/await with forEach()
// Promise timeout
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
// forEach() async loop
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}