You have no idea how helpful this was, thank you for the consistent great videos.
@zhanezar Жыл бұрын
thanks for all these tutorials on stores and context , its one of the parts of Svelte i struggled to understand but its so important
@JoyofCodeDev Жыл бұрын
It's very powerful. 🔥
@nathanellis7819 Жыл бұрын
Very happy to have found your channel. You are great! Please keep the svelteKit stuff coming. Thank you
@JoyofCodeDev Жыл бұрын
Thank you! 😄
@amorfati8277 Жыл бұрын
Great Video 🔥. Thanks for your work for svelte. You are great source of information for Svelte. I like your teaching style as you use visual to explain the concepts better.
@JoyofCodeDev Жыл бұрын
Thank you! 😄
@justingolden21 Жыл бұрын
Very helpful video! Explains a lot in a simple manner and with great examples
@nickstaresinic9933Ай бұрын
Thanks, Matija, for the clear and concise explanation that solved a problem that arose today as I was refactoring some code. (FYI, I was directed here from a reddit Q: "How do I pass data from child to parent in Svelte 5?")
@irradiance730 Жыл бұрын
Magnificent, thank you!
@tombil-certon Жыл бұрын
The thumbnail reminds me of the movie "The Emperor's New Groove" Love it
@JoyofCodeDev Жыл бұрын
I see it now. 😄
@fallen_turbo Жыл бұрын
This is a very helpful video thank you so much
@JoyofCodeDev Жыл бұрын
You're welcome! 😄
@Steakss Жыл бұрын
Thanks @Joy of Code, appreciate you.
@JoyofCodeDev Жыл бұрын
Thank you! 😌
@vlntsolo Жыл бұрын
Nice examples, thanks!
@alkmst-xyz Жыл бұрын
Great video and very practical example, love it! Perhaps a minor correction or doubt, I think it may not be necessary to give a parameter at the call site of getCount like getCount('count'), although I haven't tested it myself. Regardless, I am excited to use the Context API!
@JoyofCodeDev Жыл бұрын
Yeah, I goofed up.
@twd2 Жыл бұрын
I really like your tutorials !!!
@dc22199x Жыл бұрын
Curious about your getCount() you passed an arg 'count' 😅 This is my first time to appreciate context api, there are plenty of things that it doesn't cover in the svelte docs, crazy stuff as always 💪🙏
@JoyofCodeDev Жыл бұрын
It's a mistake! 😄
@workflowinmind11 ай бұрын
8:40 why are you passing the sttring "count" to the get method?
@codermeo8129 Жыл бұрын
I love it ❤❤❤
@InMemoryOfNeo Жыл бұрын
you're awesome bro. please make more videos with typescript and sveltekit. Thx...
@thekokoserver Жыл бұрын
You are the best 🎉
@JoyofCodeDev Жыл бұрын
Thank you! 😊
@efimgibsun7969 Жыл бұрын
Thank you ☺️ Why do you need to use setContex together with stores if you can use just stores?
@JoyofCodeDev Жыл бұрын
The store value is shared across every component instance but context isn't when you want to have reusable components.
@anupam.sam9 Жыл бұрын
The upside of this is, the store here is created only when the GrandParent component is used and Not globally, it's scoped to GrandParent components hierarchy below it. Thus Saving memory and also restricting to share this store's data globally to all components where it's not needed.
@cangurcan999 ай бұрын
Thank you for your great videos. This context + store is same as create store approach, is it right?
@thedelanyo Жыл бұрын
Succinctly explained and understood well. I'll almost be using a store whenever I use a context. Let's just say, contextual store 😅
Жыл бұрын
great video like always, thanks for the great content like always!!
@JoyofCodeDev Жыл бұрын
Thank you! 😄
@omomer3506 Жыл бұрын
Love it great stuff, If i may point out a human error, you exported getCount() woth no parameters but when calling it you wrote let count =getCount("count"), awesome job otherwise
@luczztem Жыл бұрын
impressive stuff
@bruhhhhh71811 ай бұрын
this is perfect
@kvetoslavnovak423 Жыл бұрын
Great tutorial as always, Thank you ❤ Does the store and context usage have any bad consequences for SSR?
@JoyofCodeDev Жыл бұрын
Not that I know of.
@hsdevelop5873 Жыл бұрын
great video
@Killtec Жыл бұрын
sveltekit supabase auth helpers with version 0.10 Add full server side support to auth helpers through PKCE, can you please make a video to showcase how we can use it to only call supabase via backend without showing our supabase client to the frontend. :)
@EvertvanBrussel Жыл бұрын
Hey, I just saw this video and I really appreciate it. And now that Svelte 5 is being worked on and Rich has argued that a lot of places where in the past you would've used a store, you would not just use runes. And to be honest, I'm a little skeptical about whether runes can really replace stores for every use-case. But anyway, I was wondering if you'd be willing to make a new video that goes through this same subject again but discusses whether (and if yes, how) one should replace the store here with something rune-based in Svelte 5.
@JoyofCodeDev Жыл бұрын
I wanted to look at some stores examples.
@Huntabyte Жыл бұрын
First 🔥🔥
@amorfati8277 Жыл бұрын
Two Svelte ambassadors, I like it ❤
@JoyofCodeDev Жыл бұрын
You're fast! 😄
@AakashGoplani Жыл бұрын
How can we extend this in SvelteKit? I have read `$page`, `$app` uses context API but I was not able to find a proper way to implement any such thing in SvelteKit!
@JoyofCodeDev Жыл бұрын
SvelteKit uses the same technique for its stores using the context API and stores.
@connorcallahan2231 Жыл бұрын
How does " import { Grandparent, Parent, Child } from "$lib/components"; work? When I do it, it can't find the file, do you export them somehow into one object?
@JoyofCodeDev Жыл бұрын
I export the components from `components/index.ts`.
@svelterust Жыл бұрын
@@JoyofCodeDev You can also create a path alias so that you can write $components instead, but you probably know this 😄
@v01d69 Жыл бұрын
i am very new to sveltekit and i have been watching your videos recently its very helpful! can u do a video on view transition api in svelte i am very confused about it
@JoyofCodeDev Жыл бұрын
I already have a working example but I'm waiting for SvelteKit to merge a feature. 🤫
@nguyentruongnhan1543 ай бұрын
why getCount's definition don't have any args, but you pass 'count' when you call it ?
@lying6624 Жыл бұрын
is it safe to use let variables? it feels unnatural after React. I haven't found information anywhere else on this
@JoyofCodeDev Жыл бұрын
For what exactly?
@lying6624 Жыл бұрын
@@JoyofCodeDev you are initialazing variables using let. Is it safe? Because it is always better to use const, or svelte compiler change it to const?
@JoyofCodeDev Жыл бұрын
@@lying6624 You have to use `let` because Svelte uses assignments to update values using regular JavaScript.
@lying6624 Жыл бұрын
@@JoyofCodeDev but is it safe to use let variables?
@JoyofCodeDev Жыл бұрын
@@lying6624 That's how you do it in Svelte.
@bruhhhhh71811 ай бұрын
by the way i think there is a mistake here... your function call has const count = getCount('count') but in the getCount function doesn't take any arguments.
@JoyofCodeDev11 ай бұрын
Yup! 😄
@nonefvnfvnjnjnjevjenjvonej3384 Жыл бұрын
svelte started off very minimalist and less boiler code. they are slowly moving towards complexity now. soon we will have usehooks here too.
@JoyofCodeDev Жыл бұрын
If you have a simple component you should pass a prop or dispatch a custom event. The context API existed since Svelte was made and it solves a specific problem.