Custom Svelte Store: Higher Order Store
Custom Svelte Store: Higher Order Store
---
In this video, I am going to show how to use functional programming concept, higher-order functions into Svelte stores. And I am calling it, higher-order store.
Higher order store is a function that takes in a store as an argument, and returns a new store. The returned store is derived from the input store, but with enhanced abilities.
For example, a `throttled` higher-order store takes in a store and returns a `throttled` version of the store. The store value is updated in a throttled manner.
Writing the `throttle` logic as a higher-order store allow us to easily reuse it, by applying `throttle` to any store that we want to throttle.
In the video, I've shown other examples of higher-order store, such as:
- throttle
- debounce
- readonly
- spring
---
💻 REPL: https://svelte.dev/repl/01959ea307cc4ed4aadfd251967ef4a2
📚 Related Resources
DOM Events as Svelte Store https://youtu.be/Aq-hZhX2vfU
tweened() Svelte store https://youtu.be/I5dEo7HL1LY
The Difference Between Debounce and Throttling https://css-tricks.com/the-difference-between-throttling-and-debouncing/
Higher Order Functions https://medium.com/javascript-scene/higher-order-functions-composing-software-5365cf2cbe99
🥰 Support me https://www.buymeacoffee.com/lihautan
🔗 Want to learn more from me? Check out these links:
Twitter: https://twitter.com/lihautan
Blog: https://lihautan.com/
Newsletter: https://lihautan.com/newsletter
#svelte #sveltestore
Thanks for watching 🥰 -- with love, Li Hau
Видео Custom Svelte Store: Higher Order Store канала lihautan
---
In this video, I am going to show how to use functional programming concept, higher-order functions into Svelte stores. And I am calling it, higher-order store.
Higher order store is a function that takes in a store as an argument, and returns a new store. The returned store is derived from the input store, but with enhanced abilities.
For example, a `throttled` higher-order store takes in a store and returns a `throttled` version of the store. The store value is updated in a throttled manner.
Writing the `throttle` logic as a higher-order store allow us to easily reuse it, by applying `throttle` to any store that we want to throttle.
In the video, I've shown other examples of higher-order store, such as:
- throttle
- debounce
- readonly
- spring
---
💻 REPL: https://svelte.dev/repl/01959ea307cc4ed4aadfd251967ef4a2
📚 Related Resources
DOM Events as Svelte Store https://youtu.be/Aq-hZhX2vfU
tweened() Svelte store https://youtu.be/I5dEo7HL1LY
The Difference Between Debounce and Throttling https://css-tricks.com/the-difference-between-throttling-and-debouncing/
Higher Order Functions https://medium.com/javascript-scene/higher-order-functions-composing-software-5365cf2cbe99
🥰 Support me https://www.buymeacoffee.com/lihautan
🔗 Want to learn more from me? Check out these links:
Twitter: https://twitter.com/lihautan
Blog: https://lihautan.com/
Newsletter: https://lihautan.com/newsletter
#svelte #sveltestore
Thanks for watching 🥰 -- with love, Li Hau
Видео Custom Svelte Store: Higher Order Store канала lihautan
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![Svelte Store: 3 tips to manage complex Svelte store](https://i.ytimg.com/vi/qtxG-aoXXCM/default.jpg)
![How to build svelte components & use them in React, Angular and Vue](https://i.ytimg.com/vi/RbTM785zhG4/default.jpg)
![Build Once, Use Anywhere: Microfrontends with Svelte](https://i.ytimg.com/vi/-SvfwgHPh-A/default.jpg)
![Svelte Actions: Reusing event listeners with Svelte actions](https://i.ytimg.com/vi/_IGEl4t1TSM/default.jpg)
![Fixing issue #6433 - Incorrect select value when using spread](https://i.ytimg.com/vi/AijybU_mU3Q/default.jpg)
![Svelte, Snowpack & Shoelace - Indy JS Meetup 1/2021](https://i.ytimg.com/vi/CFFzfiowVrU/default.jpg)
![Svelte - Typescript (is finally here!)](https://i.ytimg.com/vi/djRkyyBoIKs/default.jpg)
![Svelte components communicate without store / props / context?](https://i.ytimg.com/vi/lEBvoEmbpsU/default.jpg)
![The Svelte Way - E1: Passing value from child to parent](https://i.ytimg.com/vi/lqvY_0gJf_I/default.jpg)
![Data Fetching For Developers Who Are New to Svelte And Wanna Learn To Do Other Stuff Good Too](https://i.ytimg.com/vi/nR8XRpin4OI/default.jpg)
![Custom Svelte Store: Immer for Immutable Svelte store](https://i.ytimg.com/vi/mHqCAEUkiWs/default.jpg)
![Fixing Svelte issue #4767 - meta tag get svelte-xxx classname with :root](https://i.ytimg.com/vi/YvVr3sIVs7s/default.jpg)
![Intro to Svelte in "almost" less than 1 minute](https://i.ytimg.com/vi/cU8ZPBKaEwU/default.jpg)
![Svelte Shopping Cart with a custom Store](https://i.ytimg.com/vi/2QsqgEU7pcU/default.jpg)
![SvelteKit State Management with Stores Tutorial](https://i.ytimg.com/vi/yL-u596YbF8/default.jpg)
![Tim Raderschad: Modern fetch in svelte using stores](https://i.ytimg.com/vi/IUHkSoBxyLM/default.jpg)
![How to actually pass Svelte component through props?](https://i.ytimg.com/vi/2nohdjOFEnQ/default.jpg)
![Undo / Redo with Svelte Store](https://i.ytimg.com/vi/d2xsgavIDiQ/default.jpg)
![Svelte Crash Course](https://i.ytimg.com/vi/uK2RnIzrQ0M/default.jpg)
![How to use Svelte component inside a React app?](https://i.ytimg.com/vi/6MI9mirMh6w/default.jpg)