Тёмный

Vue 3 Watch vs WatchEffect! Watch OUT, you'll probably get this wrong! 

Program With Erik
Подписаться 123 тыс.
Просмотров 16 тыс.
50% 1

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 43   
@ProgramWithErik
@ProgramWithErik 2 года назад
Hey! I'm working on an advanced Vue.js course! If you'd like to know more, click here -> www.vuecourse.tech/ and sign up! I'll get you a free cheat sheet and I'll let you know when it's out!
@marghen7636
@marghen7636 11 месяцев назад
Is it out yet by any chance?
@dasten123
@dasten123 2 года назад
So `watch` works like the watch option in Vue2 and `watchEffect` kinda works like `computed`, except that it doesn't return anything
@nested9301
@nested9301 Год назад
watch(source, (newValue, oldValue) => { // executed immediately, then again when `source` changes }, { immediate: true }) you can pass the immediate to true if you want it to execute immediatly like watchEffect there is a lot of thing to do the same thing in vue damn
@topmemesforyou5848
@topmemesforyou5848 2 года назад
Can you do a video on vitejs SSR with vue 3 and a simple example of data preferching?!
@joelkatusiime3015
@joelkatusiime3015 2 года назад
This is pletty nice. For someone coming from React to Vue, I was wondering how I would implement my useEffect's. This has got to be it. Thanx.
@ProgramWithErik
@ProgramWithErik 2 года назад
Glad I could help!
@possumkeys
@possumkeys 2 года назад
Why are you moving from react?
@joelkatusiime3015
@joelkatusiime3015 2 года назад
@@possumkeys I am just broadening my knowledge. I need to master another frontend framework apart from React.
@ColinRichardson
@ColinRichardson 2 года назад
From what I understood, which I think you "kind of" mentioned but I don't think you pressed the point home. Watch() allows you to watch Ref A and do something with Ref B and C (but never actually read A). Where as WatchEffects() will only run when Ref B and C changes, not when Ref A does anything. Because you don't read A within the effect.
@davidzita1404
@davidzita1404 2 года назад
Thanks, Please more advanced videos and please make video ho to make non reactive copy of ref,reactive, props ....+ vue reactivity explained. Thanks 🙏
@megr
@megr 2 года назад
You just saved the day. I was stuck trying to make a watch works properly, but I was wrong. Thank you so much!
@AnassSanba-f5d
@AnassSanba-f5d Год назад
Watcheffect like useEffect in react but better
@ricko13
@ricko13 2 года назад
maybe they should've just named them like *LazyWatch* and *InitWatch* or something like that
@possumkeys
@possumkeys 2 года назад
Naming things like react which I find is horribly named.
@ongke3655
@ongke3655 2 года назад
Hi, you seem love to use typescript in your project. So do I. But there's more 3rd party libraries do not have typescript support yet. Such as wowjs. Because of that, I cant use typescript in my project. So javascript without typescript is the safe and stable choice now, right?
@liamconverse8950
@liamconverse8950 2 года назад
Wow, watch() is super useful for what I was trying to do, thanks for explaining it! Vue 3 is pretty awesome
@sunrisexoxo220
@sunrisexoxo220 2 года назад
your videos are good but you take too much time, like these videos can be reduced to 5 min
@gligorpecev5199
@gligorpecev5199 2 года назад
lol i was about to ask about the theme name and you answered it
@viktorbasurto3652
@viktorbasurto3652 2 года назад
Great content 👍 100%
@ProgramWithErik
@ProgramWithErik 2 года назад
Thank you 🙌
@l2cri
@l2cri 2 года назад
watch ( () => write.value, ... and watch(write, ... What's are differences ?
@sambitsahoo2700
@sambitsahoo2700 2 года назад
Same
@noblesavage149
@noblesavage149 2 года назад
M-x Forever
@studiowebselect
@studiowebselect 2 года назад
Watch in Vue 2 you can add immediate: true Seam not possible anymore. I would make a function called in the watch and created life cycle
@blank4157
@blank4157 2 года назад
It's possible, watch function in composition API is same as its watch counterpart in options API. You can provide those options as third argument to watch function, check official docs for detailed info.
@ProgramWithErik
@ProgramWithErik 2 года назад
Yup, I believe so.
@AndrewRusinas
@AndrewRusinas 2 года назад
Wow! Congratulations on your new job!
@ProgramWithErik
@ProgramWithErik 2 года назад
Thank you!!
@wahomemutahi1008
@wahomemutahi1008 2 года назад
Awesome tutorial man...
@ProgramWithErik
@ProgramWithErik 2 года назад
Glad you liked it!
@Rivhoy6ivu7r
@Rivhoy6ivu7r 2 года назад
You need to work on your CSS man. Its good content and yes you are focusing on main thing but something looks off and its that ugly style behind. As a frontend guy please spend more time on CSS, you will look better. I am telling you this not on basis of this vid only.
@ProgramWithErik
@ProgramWithErik 2 года назад
You bet!
@possumkeys
@possumkeys 2 года назад
UX/UI is done for purpose, not for the sake of it. This video is to be informative, and majority of the target audience don't really care, they are here for the JS. Now a CSS tutorial on the other hand.....
@Rivhoy6ivu7r
@Rivhoy6ivu7r 2 года назад
​@@possumkeys I understand what you are saying. I just told him what I felt and its up to him to process my feedback. Majority of the audience may not care but maybe some do or maybe some are unaware that they do.
@Rivhoy6ivu7r
@Rivhoy6ivu7r 2 года назад
Also there is very strong aesthetic component in his webcam feed and also in code editor. This perhaps amplifies the insipidness of the page. Unrelated to actual content but its noticeable.
@caiovinicius7871
@caiovinicius7871 2 года назад
I love watch, i usually use this to grab route changes and send some data to my server.
@possumkeys
@possumkeys 2 года назад
Why?
@caiovinicius7871
@caiovinicius7871 2 года назад
@@possumkeys Because it's a middleware.
@LukenSkyne
@LukenSkyne 2 года назад
Good stuff, didn't know about watchEffect yet, seems very svelte'
@sambitsahoo2700
@sambitsahoo2700 2 года назад
Hmm
@RaZziaN1
@RaZziaN1 2 года назад
dunno about watchEffect but it sounds like react useEffect..
Далее
Every New Vue Developer Has Made These Mistakes...
18:04
React Is King? My Reaction To Ben Awad On Vue.js!
12:48
Trying Vue.js for the First Time
11:59
Просмотров 312 тыс.
This Vue Mistake Was A Real Problem
8:02
Просмотров 3,7 тыс.