Тёмный

Build a Reactive Search Filter with Svelte 

Huntabyte
Подписаться 25 тыс.
Просмотров 26 тыс.
50% 1

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

 

20 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 77   
@mbalslow
@mbalslow Год назад
Great video once again! A good follow-up video would be to cover the same functionality but instead of doing search already loaded records, it would be up against a REST API with a filter. Possibly with a debounce logic.
@Huntabyte
@Huntabyte Год назад
Great idea!
@austinbryan5170
@austinbryan5170 Год назад
I'm trying to do this now with my Wordpress website and apply some of the things you've taught
@marktwain3083
@marktwain3083 Год назад
That's exactly what I expected this video to be about, I believe this scenario is more common. @@Huntabyte please consider making a video relevant to this topic, you are the only youtuber out there that's so easy to understand and it would be super useful for those of us who are getting started with svelte and sveltekit.
@frederikclement7795
@frederikclement7795 Год назад
Beautiful! I appreciate how beginner friendly your videos are and help to create real-world functionality. Also great to focus on js first and adding ts later. Thank you!
@Huntabyte
@Huntabyte Год назад
You're very welcome!
@KevinMacKenzie61
@KevinMacKenzie61 Год назад
Another great video. Loved the way you handled both styles with the TS at the end.
@Huntabyte
@Huntabyte Год назад
Thank you, Kevin!
@merrycruise328
@merrycruise328 7 месяцев назад
Thank you for such a descriptive tutorial, not even chatGPT could help me with this!! ❤
@zackadam2598
@zackadam2598 Год назад
This channel has be really helpful, particularly post-data/load changes. From a python dev with almost no js experience, thanks!
@Huntabyte
@Huntabyte Год назад
I'm glad to hear that, you're very welcome!
@frankspin9124
@frankspin9124 Год назад
Great video. Would love to see a video on building category/tags filters in combination with pagination.
@Huntabyte
@Huntabyte Год назад
Good idea!
@gabrielbrisson6012
@gabrielbrisson6012 8 месяцев назад
Great video, as always!
@danielk.9321
@danielk.9321 Год назад
You always cover the most useful topics. Thank you 😊
@Huntabyte
@Huntabyte Год назад
You’re welcome!
@codewithguillaume
@codewithguillaume Год назад
Hello my friend sorry to say that but I am going to steal this for my next course on Svelte 😂❤ thanks for your work this is amazing!
@Huntabyte
@Huntabyte Год назад
You’re very welcome!
@itspaulinamac
@itspaulinamac Год назад
Thanks for always explaining everything so well! Great content!
@Huntabyte
@Huntabyte Год назад
My pleasure!
@kaviisuri9997
@kaviisuri9997 Год назад
Awesome video! One idea, Why not make searchTerm a writable store, and make searchStore a derived store that recomputes filtered values based on searchTerm? Basically eliminate the need for manual subscription
@Huntabyte
@Huntabyte Год назад
That's also a great way to handle this!
@jesper.ordrup
@jesper.ordrup Год назад
Super video. And great that you add the typescript boilerplate last. It makes it so much easier to follow. (Not a fan of typescript. Using it, but not a fan. At all)
@Huntabyte
@Huntabyte Год назад
It can be a bit of a pain for small apps, but as the app scales not having that type safety can become a nightmare! I'm glad you liked the flow!
@jesper.ordrup
@jesper.ordrup Год назад
@@Huntabyte while true it still makes code look busy. Lots of "annotations" that distracts from the real logic. I kinda like jsdocs as a lightweight approach. Keeping it in comments can make it easier to keep out of sight. Funny enough, I come from c# so go figure 😏
@stor-tech
@stor-tech Год назад
Thanks soo much for this, my implementation was alot more complex, but you made my life alot easier. love it
@Huntabyte
@Huntabyte Год назад
You're very welcome!
@salahiddinediouri280
@salahiddinediouri280 Год назад
This is a great use case, thank you for the video and for the cool explanation
@Huntabyte
@Huntabyte Год назад
You're welcome!
@adriansanmartin1313
@adriansanmartin1313 10 месяцев назад
Gracias por siempre tener una respuesta a mis dudas.. ya paso bastante tiempo desde que vi este video, pero hoy le di un repaso. Saludos
@davidlythgoe809
@davidlythgoe809 Год назад
so accessible and helpful! thank you! Really great style.
@Huntabyte
@Huntabyte Год назад
You’re very welcome!
@jipsy8612
@jipsy8612 Год назад
Again an other great video, Thanks for all of your work and your time ! ;)
@irreal2
@irreal2 Год назад
If you are already "pre-computing" the searchTerm property on each product ahead of time, why not convert it to lower case at that point? Instead, you do a .toLowerCase() each time the search term updates, causing a whole bunch of extra work.
@parkerAmv
@parkerAmv Год назад
Really great, Thank you for the sveltekit playlist it really help me to practice. Keep update!
@Huntabyte
@Huntabyte Год назад
I'm glad to hear that!
@ashshkapoor
@ashshkapoor Год назад
Nice! I learned a new way to search. Thank you! :)
@Huntabyte
@Huntabyte Год назад
Glad it was helpful!
@pevey
@pevey Год назад
This is really next level. Great video.
@cezarlacatus
@cezarlacatus Год назад
Thank you very much ! I was looking into this
@Huntabyte
@Huntabyte Год назад
You're very welcome!
@mcdba41
@mcdba41 Год назад
Thank you! Great content!
@Huntabyte
@Huntabyte Год назад
My pleasure!
@kbaratyants
@kbaratyants 10 месяцев назад
Excellent instructional video! How can additional filters be incorporated into the application, appearing as additional buttons? For instance, when clicking the button labeled "laptops," only laptop-related items would be displayed, making it easy to locate specific items within the laptops category.
@allisterfiend_2112
@allisterfiend_2112 4 месяца назад
Nice, tutorial! It would be cool to see you do this same thing using Runes from Svelte 5 so we could see the difference in the amount of work that has to be done.
@Huntabyte
@Huntabyte 4 месяца назад
Will do!
@esquilo_atomico
@esquilo_atomico Год назад
Grato demais !!!!
@omomer3506
@omomer3506 Год назад
Real Noice, I was using the reactive $: inside the component and filtering it out there, basically what you did in the store mine was in the component it self, somehow yours seems cleaner but i am too lazy to update mine 😁
@チョリパン-j4f
@チョリパン-j4f 9 месяцев назад
yoo thank you for this!
@inDefEE
@inDefEE Год назад
can you explain why a store is useful here vs. a hook? We aren’t using these functions, stores, or filter values anywhere else or across cross components or pages. Just curious on the choice to use a store. Thanks!
@Huntabyte
@Huntabyte Год назад
It’s more so mean to be an example of how you could reuse the same logic throughout the app for various sets of data! Poor explanation for that part 😂
@inDefEE
@inDefEE Год назад
@@Huntabyte ahhh ok got it. I do like this for something like that. Another good use case I think would be selecting and filtering items across pagination. Thanks for the video and response! I’m learning Svelte right now for my side business and it has been a blast. Your vid’s help a lot!
@legionsra
@legionsra Год назад
Although I like the video. The reason this is working is because the searchHandler is modifying on real time the reference of the object the store is located. No Svelte functionality here and the reason reactivity is working is because Svelte actually deeply watches changes on the object but you should not rely on that. If this was done with primitive values this will never work. I would have created instead a second derived store with data filtered based on a search term and then this is the subscribed store in the results panel. But overall is great
@legionsra
@legionsra Год назад
Nobody should ever modify a store directly in a subscribe function. Subscription is meant to be read, not to be written.
@Huntabyte
@Huntabyte Год назад
Hey thanks for that feedback, if you have discord or could send here - would you mind linking a REPL with an example of this, I’d greatly appreciate it! There’s always a few different ways to accomplish the same thing and I’m always looking for the best ways!
@morgo52
@morgo52 Год назад
I was about to reply with the same idea. Since the handler is in implemented in your search file it also doesn't make sense to require the consumer to link this up. The derived store would keep this in the same place and give you the option to have multiple derived stores that can be subbed to depending on if you wanted to provide different filter algorithms. e.g. includesSearchResults, fuzzySearchResults, etc...
@legionsra
@legionsra Год назад
​ @Huntabyte I made a simplistic example with all inside page.svelte in 9 lines. But I can give you also all in one single store function stackblitz /edit/github-tnt8vu?file=src/routes/+page.svelte (beware the missing domain)
@SeanLazer
@SeanLazer Год назад
@@legionsra This was helpful, thanks for sharing!
@DennisPing
@DennisPing Год назад
What font family are you using?! It kinda looks like Fira Code but a little less busy. I want to try it.
@Huntabyte
@Huntabyte Год назад
Cascadia Code!
@theIbraDev
@theIbraDev Год назад
What browser are you using? Neat to have the tabs on the left side.
@Huntabyte
@Huntabyte Год назад
Microsoft Edge!
@theIbraDev
@theIbraDev Год назад
@@Huntabyte i just edited the css of firefox to get the same layout :D
@_pro_grammer_
@_pro_grammer_ Год назад
Nice💙
@Huntabyte
@Huntabyte Год назад
Thank you!
@RiddlerRiddle
@RiddlerRiddle 7 месяцев назад
is there a limit to data size, can this handle millions of rows of data or is it for something like 1k-2k rows of data?
@TravisRayLive
@TravisRayLive Год назад
Wanna point out that you wouldn't do this in a page.svelte file normally, but rather the page.js or page.server.js file. You don't typically execute functional logic on the view itself.
@SeanLazer
@SeanLazer Год назад
Wouldn't that require a roundtrip to the server every time though? If you already have all your data loaded and the collection isn't that large client side filtering is probably the fastest way to handle it. But fair to say that those cases are rarer than cases where you're filtering from a DB or third party API
@Huntabyte
@Huntabyte Год назад
Yeah, this video isn't covering how to search via a 'search' endpoint - but moreso a way to filter the already loaded data. There are multiple ways to accomplish the same thing, including an even simpler way then I demonstrated here.
@acharafranklyn5167
@acharafranklyn5167 Год назад
This is what makes svelte far better than react.... For you to implement this n React you would have to use hooks and reducers
@Kostyshko
@Kostyshko 10 месяцев назад
It`s not real, proper types. You should not use any. And what is PropertyKey? It`s indefined
Далее
Dark Mode Theme Switcher in Svelte
14:02
Просмотров 15 тыс.
Svelte 5's Secret Weapon: Classes + Context
18:14
Просмотров 23 тыс.
Мечты, которые сбылись♥️
00:17
Просмотров 560 тыс.
Тестирую гаджет для роллов! 🙈
00:42
Svelte Is Good For Beginners
9:28
Просмотров 81 тыс.
Why I STOPPED Using Next.js And Chose Astro Instead
12:10
Let's Build: Authenticated API's with PocketBase
23:42
Просмотров 1,3 тыс.
Using The Svelte Context API With Stores
10:17
Просмотров 13 тыс.
The Svelte 5 Guide For Beginners
21:41
Просмотров 27 тыс.
React visually explained: 'use client'
15:57
Просмотров 53 тыс.
Best UI Library for Svelte
16:13
Просмотров 109 тыс.
14 Awesome Real World Projects Using Svelte
10:49
Просмотров 27 тыс.
Мечты, которые сбылись♥️
00:17
Просмотров 560 тыс.