Uploaded November 2023 | Updated November 2026, 20 hours ago
❗️ See the comments - I over-engineered this, my solution is far from ideal. Good discussion in comments!
👉 I am writing a book on tooling! Check it out: https://lachlan-miller.ck.page/92dfa021b3
🐦 twitter.com/Lachlan19900
I had an interview recently which featured an interesting question. In this video, I share the question and my solution, along with a construct, the mighty deferred promise. There's a TC39 proposal for it under the name "withResolvers": github.com/tc39/proposal-promise-with-resolvers
Corrections: 5:00 p-defer isn't necessary here - you can just return a promise. p-defer is useful if you want to resolve or reject the promise afterwards, from outside the location it was originally created. Example improvement: gist.github.com/lmiller1990/26eb3c2d76eb8c122a0012c1e47dc15e. See comments for discussion.
❗️ See the comments - I over-engineered this, my solution is far from ideal. Good discussion in comments!
👉 I am writing a book on tooling! Check it out: https://lachlan-miller.ck.page/92dfa021b3
🐦 twitter.com/Lachlan19900
I had an interview recently which featured an interesting question. In this video, I share the question and my solution, along with a construct, the mighty deferred promise. There's a TC39 proposal for it under the name "withResolvers": github.com/tc39/proposal-promise-with-resolvers
Corrections: 5:00 p-defer isn't necessary here - you can just return a promise. p-defer is useful if you want to resolve or reject the promise afterwards, from outside the location it was originally created. Example improvement: gist.github.com/lmiller1990/26eb3c2d76eb8c122a0012c1e47dc15e. See comments for discussion.
![Vue Test Utils integration and more examples - [Vue Testing Library 8/8]
▶️ Full playlist: https://www.youtube.com/playlist?list=PLC2LZCNWKL9YdD4Z4V6guveajQoKN8rui
📗 $5 off my Design Patterns for Vue.js with YT_5_OFF: https://lachlan-miller.me/design-patterns-for-vuejs
🔨 Course on Composition API, TypeScript and Testing: https://www.udemy.com/course/vuejs-3-the-composition-api/?referralCode=0C911BD2BD6C57007F36
🎥 Complete Vue.js (Options/Composition, Vuex, Router): https://www.udemy.com/course/complete-vuejs-3-crash-course-composition-api-vue-router-vuex/?referralCode=765A6E679914BF6E60AF Vue Test Utils integration and more examples - [Vue Testing Library 8/8]](https://i.ytimg.com/vi/fi4gwBkryxE/mqdefault.jpg)
![[Testing Vue 3 apps] 1.2 - Factory functions for concise tests
My courses and advanced screencasts: https://vuejs-course.com/
My website (sign-up for my book on Vue testing!) https://lachlan-miller.me/ [Testing Vue 3 apps] 1.2 - Factory functions for concise tests](https://i.ytimg.com/vi/gFDMazldMQA/mqdefault.jpg)

![Writing to a PDF [Vue 3 Custom Renderers 4/7]
▶️ Full playlist: https://www.youtube.com/playlist?list=PLC2LZCNWKL9b876nPMVULEyBzkVoH8B7n
⌨️ Source code: https://github.com/lmiller1990/vue-pdf-renderer-demo
📗 $5 off my Design Patterns for Vue.js with YT_5_OFF: https://lachlan-miller.me/design-patterns-for-vuejs
🔨 Course on Composition API, TypeScript and Testing: https://www.udemy.com/course/vuejs-3-the-composition-api/?referralCode=0C911BD2BD6C57007F36
🎥 Complete Vue.js (Options/Composition, Vuex, Router): https://www.udemy.com/course/complete-vuejs-3-crash-course-composition-api-vue-router-vuex/?referralCode=765A6E679914BF6E60AF
🐦 Twitter: https://twitter.com/Lachlan19900 Writing to a PDF [Vue 3 Custom Renderers 4/7]](https://i.ytimg.com/vi/gxWvx2wuH2k/mqdefault.jpg)
![[Testing Composables with Tic Tac Toe] Some Defensive Programming (9/10)
Full playlist: https://www.youtube.com/playlist?list=PLC2LZCNWKL9bxH1aVRVKoaq6Y2KKX6J5g
Sign up for my book, Vue design patterns: https://lachlan-miller.me/design-patterns-for-vuejs
Course on Composition API, TypeScript and Testing: https://www.udemy.com/course/vuejs-3-the-composition-api/?referralCode=0C911BD2BD6C57007F36
Complete Vue.js (Options/Composition, Vuex, Router): https://www.udemy.com/course/complete-vuejs-3-crash-course-composition-api-vue-router-vuex/?referralCode=765A6E679914BF6E60AF [Testing Composables with Tic Tac Toe] Some Defensive Programming (9/10)](https://i.ytimg.com/vi/hhX066yXuc8/mqdefault.jpg)

![[Vue.js 3 Crash Course] 1.4: Control Flow with v-if and v-else
WATCH THE UPDATED PLAYLIST HERE, ITS WAY BETTER https://youtube.com/playlist?list=PLC2LZCNWKL9bICnF4PdWlLEkRH00Qv6mx
Hi! 👋 This is the first module of my entirely re-recorded Complete Vue.js 3 course.
🎥 I re-record it once a year, to keep it up to date, make improvements, etc!
🎉 Full course includes Options + Composition APIs, Vuex and Vue Router (4.5 hours, 85 lectures).
📝 4 fundamental modules (Options, Composition, Vuex, Vue Router)
🧑💻 4 projects (Form Validation, Pokemon Cards, Microblog, Photo Album)
😇 If you enjoy my teaching style, you can buy the full course!
👉 BUY ON GUMROAD $10 OFF WITH YOUTUBE_10: https://gumroad.com/l/complete-vuejs
👉 BUY ON UDEMY: https://www.udemy.com/course/complete-vuejs-3-crash-course-composition-api-vue-router-vuex/?referralCode=765A6E679914BF6E60AF
I hope you find the content useful! 👊 Happy coding ⚡️
Learn more: https://vuejs-course.com/complete-vuejs [Vue.js 3 Crash Course] 1.4: Control Flow with v-if and v-else](https://i.ytimg.com/vi/i4dAEe4K7Vg/mqdefault.jpg)



![DOM Queries - [Vue Testing Library 1/8]
▶️ Full playlist: https://www.youtube.com/playlist?list=PLC2LZCNWKL9YdD4Z4V6guveajQoKN8rui
📗 $5 off my Design Patterns for Vue.js with YT_5_OFF: https://lachlan-miller.me/design-patterns-for-vuejs
🔨 Course on Composition API, TypeScript and Testing: https://www.udemy.com/course/vuejs-3-the-composition-api/?referralCode=0C911BD2BD6C57007F36
🎥 Complete Vue.js (Options/Composition, Vuex, Router): https://www.udemy.com/course/complete-vuejs-3-crash-course-composition-api-vue-router-vuex/?referralCode=765A6E679914BF6E60AF DOM Queries - [Vue Testing Library 1/8]](https://i.ytimg.com/vi/kMtqZK8z1XE/mqdefault.jpg)