Use {{#let}} to Avoid Recomputation
এই দিনের কাজ · মোট ১০′০/১ (০%)
- Use {{#let}} to Avoid Recomputation — নিচের Incorrect কোড পড়ে, না দেখে ঠিক সংস্করণটা লিখুন; তারপর "কেন" ইংরেজিতে ২–৩ বাক্যে জোরে বলুন, আর খাতায় এক লাইন: নিজের কাজে এটা কোথায় দেখেছেন
Incorrect (recomputes on every reference):
// app/components/user-card.gjs <template> <div class="user-card"> {{#if (and this.user.isActive (not this.user.isDeleted))}} <h3>{{this.user.fullName}}</h3> <p>Status: Active</p> {{/if}} {{#if (and this.user.isActive (not this.user.isDeleted))}} <button {{on "click" this.editUser}}>Edit</button> {{/if}} {{#if (and this.user.isActive (not this.user.isDeleted))}} <button {{on "click" this.deleteUser}}>Delete</button> {{/if}} </div> </template>১০′🔁 ঝালাই হবেimpact · MEDIUMCorrect: আগে নিজে লিখুন
দিন শেষে — নিজেকে যাচাই
না দেখে ঠিকটা লেখা, আর "কেন" ইংরেজিতে জোরে বলা হয়েছে?
উত্তরের আগে উপরের কাজ না দেখে মনে করুন এই দিনে কী কী করেছেন। 🧠 Test yourself