Sponsored by Bryntum ๐ฎโโ๏ธ
World Class Web Components
โ CHALLENGE
World Class Web Components
const weakMap = new WeakMap();
const arr = [1, 2, 3].map(n => ({ n }));
arr.forEach(obj => weakMap.set(obj, obj.n * 2));
arr.pop(); // Remove the last element
const result = arr.reduce((acc, obj) => acc + weakMap.get(obj), 0);
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
โค2
2๐8๐ฅ4๐ค3โค1
Sponsored by Bryntum ๐ฎโโ๏ธ
World Class Web Components
๐ฒ LogTape: Simple Logging Library with Zero Dependencies
Iโm digging this new style of library that promises support across all the main runtimes (Node, Deno, Bun) as well as edge functions and browser devtools.
Hong Minhee
World Class Web Components
Iโm digging this new style of library that promises support across all the main runtimes (Node, Deno, Bun) as well as edge functions and browser devtools.
Hong Minhee
Please open Telegram to view this post
VIEW IN TELEGRAM
2๐4โค1๐ฅ1
Sponsored by Bryntum ๐ฎโโ๏ธ
World Class Web Components
โ CHALLENGE
World Class Web Components
function* infiniteGenerator() {
let i = 0;
while (true) {
yield i++;
}
}
const weakMap = new WeakMap();
const gen = infiniteGenerator();
weakMap.set(gen, gen.next().value);
const result = weakMap.get(gen) + gen.next().value;
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
2๐15๐ฅ4โค3
๐ฅ8๐3
Sponsored by Bryntum ๐ฎโโ๏ธ
World Class Web Components
๐ธ Milkdown: Plugin-Driven WYSIWYG Markdown Editor Framework
A lightweight WYSIWYG Markdown editor based around a plugin system that enables a significant level of customization. Itโs neat to see the docs are rendered by the editor itself. GitHub repo.
Mirone
World Class Web Components
A lightweight WYSIWYG Markdown editor based around a plugin system that enables a significant level of customization. Itโs neat to see the docs are rendered by the editor itself. GitHub repo.
Mirone
Please open Telegram to view this post
VIEW IN TELEGRAM
2โค3๐3๐ฅ3
๐8โค1๐ฅ1๐คฃ1
Sponsored by Bryntum ๐ฎโโ๏ธ
World Class Web Components
โ CHALLENGE
World Class Web Components
const weakMap = new WeakMap();
let obj = { name: 'initial' };
function changeName(obj) {
weakMap.set(obj, obj.name);
obj.name = 'changed';
}
changeName(obj);
console.log(weakMap.get(obj));
Please open Telegram to view this post
VIEW IN TELEGRAM
Sponsored by Bryntum ๐ฎโโ๏ธ
World Class Web Components
โ CHALLENGE
World Class Web Components
const weakMap = new WeakMap();
const arr = [1, 2, 3, 4];
const objs = arr.map(n => ({ n }));
objs.forEach((obj, index) => weakMap.set(obj, arr.slice(0, index + 1)));
const result = objs.map(obj => weakMap.get(obj).reduce((acc, num) => acc + num, 0));
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
๐7โค2๐ค2
5๐ฅ7๐2
Sponsored by Bryntum ๐ฎโโ๏ธ
World Class Web Components
โ CHALLENGE
World Class Web Components
const weakMap = new WeakMap();
const arr = [{}, {}, {}];
arr.forEach((obj, index) => weakMap.set(obj, index));
arr.splice(1, 1); // Remove the second element
const result = arr.map(obj => weakMap.get(obj));
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
๐5๐ฅ2โค1
๐8๐คฉ4โค1๐ฅ1
Sponsored by Bryntum ๐ฎโโ๏ธ
World Class Web Components
๐ฒ How to Create an NPM Package in 2024
Sounds simple, but there are a lot of steps involved if you want to follow best practices, introduce useful tools, and get things just right. Matt Pocock walks through the process here, and thereโs a 14-minute screencast too, if youโd prefer to watch along.
Matt Pocock
World Class Web Components
Sounds simple, but there are a lot of steps involved if you want to follow best practices, introduce useful tools, and get things just right. Matt Pocock walks through the process here, and thereโs a 14-minute screencast too, if youโd prefer to watch along.
Matt Pocock
Please open Telegram to view this post
VIEW IN TELEGRAM
1โค3๐3๐ฅ1
Sponsored by Bryntum ๐ฎโโ๏ธ
World Class Web Components
โ๏ธ JS Dates are About to Be Fixed
Handling dates and times is famously a painful area for programmers and JavaScript hasnโt done a lot to make it easier. Libraries like Moment.js help a lot, but Iago looks at how the Temporal proposal and its features will begin to help a lot more over time.
Iago Lastra
World Class Web Components
Handling dates and times is famously a painful area for programmers and JavaScript hasnโt done a lot to make it easier. Libraries like Moment.js help a lot, but Iago looks at how the Temporal proposal and its features will begin to help a lot more over time.
Iago Lastra
Please open Telegram to view this post
VIEW IN TELEGRAM
2โค3๐3๐ฅ1
Sponsored by Bryntum ๐ฎโโ๏ธ
World Class Web Components
โ CHALLENGE
World Class Web Components
const obj = {
outer: 1,
inner: {
outer: 10,
inner: 20
}
};
let result = 0;
with (obj) {
result += outer;
with (inner) {
result += outer + inner;
}
}
console.log(result);
Please open Telegram to view this post
VIEW IN TELEGRAM
๐5๐ค2
2๐ฅ9โค6๐6
const numbers = [0,0,0];
let i = 0;
const result = numbers.reduce((acc, _) => {
return ++acc;
}, i);
console.log(i, result);
Please open Telegram to view this post
VIEW IN TELEGRAM
๐3
3โค12๐8๐ค8๐ฅ2
Far from being โyet another bundlerโ with its own approach and terminology to learn, Rspack prides itself on being webpack API and ecosystem compatible, while offering many times the performance. The team now considers it production ready and encourages you to try your webpack-based projects on it.
Rspack Contributors
Please open Telegram to view this post
VIEW IN TELEGRAM
โค3๐2๐ฅ1
CHALLENGE
function createCounter() {
let count = 0;
return {
increment() {
count++;
return count;
},
getCount() {
return count;
}
};
}
const counter = createCounter();
console.log(counter.increment());
console.log(counter.getCount());
console.log(counter.increment());
console.log(counter.getCount());
๐7โค4๐ฅ3
โค10๐7๐ฅ1