Myvideo

Guest

Login

Svelte components communicate without store / props / context

Uploaded By: Myvideo
1 view
0
0 votes
0

How do Svelte components communicate without store / props / context? ✨❓ Svelte Question Time ❓✨ “You have a Svelte question, I have an answer“ 😱😍 Introduction 00:00 Sometimes, Svelte components need to communicate with each other, without using store, props, or context. Examples 00:43 There are situations where the 2 components are not parent-child or siblings with each other. So, it does not make sense to communicate through props or context. The components may not be sharing the same data as well, so communicate through stores is out of the picture too. An example of this, is in a e-commerce platform, where the 2 components are the shopping cart and an item card. The 2 components are not parent-child relationship, does not share the common parent (maybe except the root component). The 2 components do not share the same data, shopping cart uses cart data, and item card uses item data, (may have some commonalities, but they come from different API) So, in this case, how would you notify the shopping

Share with your friends

Link:

Embed:

Video Size:

Custom size:

x

Add to Playlist:

Favorites
My Playlist
Watch Later