博文

目前显示的是 九月 11, 2024的博文

Scripting News: Wednesday, September 11, 2024

图片
Wednesday, September 11, 2024 The most encouraging thing about last night's debate was that the moderators were journalists. When Trump repeated his most egregious lie about murdering babies being legal in certain states, moderator Muir confidently, almost derisively, said that there is no such thing. And when Trump said he didn't admit he lost the election, and then when challenged said in a snotty way he was being sarcastic, Muir plainly that wasn't true either. It was like the Monty Python dead parrot sketch . ABC News was the last place you'd expect real journalism to surface, maybe the NYT et al will follow their lead. # I wouldn't have traded places with Harris for anything in the world, she did fantastic. The pressure on her was enormous. I don't think Trump said one thing that was true. And Harris made the point that the division is coming from that guy over there, and if we don't want it all we have to do is turn the freaking page...

🔥 (#182) Building reactivity from the ground up

图片
Hey all, In case you missed it, I just launched a free mini-course called Reactivity From Scratch . It's a free course that goes over how to build your own Composition API inspired reactivity system from scratch. No matter your skill level, I think you'll find it useful! Check it out here: Reactivity From Scratch . Of course, I also have some great tips for you. — Michael 🔥 Example of a Composable Using the Options Object Pattern Let's create a useEvent composable that will make it easier to add event listeners. We'll use the EventTarget.addEventListener method, which require the event and handler parameters. These are the first two required parameters: export function useEvent ( event , handler ) {}; But we also need to know which element to target. Since we can default to the window , we'll make this our first option: export function useEvent ( event , handler , options ) { // Default to targeting the window const { t...