博文

目前显示的是 二月 5, 2025的博文

Scripting News: Wednesday, February 5, 2025

图片
Wednesday, February 5, 2025 One of my next projects, Murphy-willing, will be JavaScriptScript . # Highly recommend this week's Ezra Klein podcast . It made me wonder if any of the readers of my blog voted for Trump. I can't imagine too many did, unless they've been willing to overlook my strenuous support for any option that opposes him. However if any of you are still here, I'd like you to know that what's happening now is exactly what we thought would happen. If you agree that this is unacceptable, maybe we can use that as common ground to work together to get our country back from the chaotic authoritarian mess that Elon Musk is turning it into. He makes Trump look like an absolute moderate. Certainly no one who voted for Trump with any kind of appreciation for the American system, where your vote and mine matter, can stand by and not object to what he's doing to our system of government. If not now, keep this in mind as Musk's chaos bec...

🔥 (#203) Nesting reactive objects, composable mini tips, and more

图片
Read this on my blog Hey all! This is a quieter week for me. I'm mostly heads down working on the big update and re-recording of Mastering Nuxt to bring it all up to date. The code is nearly there, just a little bit of polishing left to make it fantastic. — Michael 🔥 Nesting Reactive Objects Here's a nuance to nesting reactive objects that's tripped me up. Nesting a ref in a reactive array keeps everything reactive as expected: const arr = reactive ([]); arr . push ( ref ( 'hello' )); arr . push ( ref ( 'world' )); setTimeout (() => ( arr [ 0 ]. value = 'nothing' ), 1000 ); But putting this ref inside a non-reactive object breaks this reactivity: const arr = reactive ([]); arr . push ({ text : ref ( 'hello' ), }); arr . push ({ text : ref ( 'world' ), }); setTimeout (() => ( arr [ 0 ]. value = 'nothing' ), 1000 ); I gave a hint i...