Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 30, 2020 10:12 am GMT

A nice intro to Svelte Data Fetching

Looking at Svelte it really looks promising and I can see why many people will learn it and use it in the future.

I just see a lot of issues that are quirky to deal with in React, like data fetching in components, are solved more elegantly in Svelte .

If you want to learn about all the things you need to handle when doing data fetching in React take a look at:

Correctly handling async/await in React components
Correctly handling async/await in React components - Part 2

Data fetching

Now comparing the React way of doing it to Svelte - I think the Svelte approach is much nicer:

Why you should learn Svelte

You should learn Svelte not because it's the new cool kid around the block, but because it adds new paradigm shifts to frontend development, that can certainly help you:

  1. Less boilerplate code due to handling state and reactivity in an easy way
  2. Global state management built in
  3. No Virtual DOM means faster renders due to avoiding not needed CPU cycles
  4. Heavy lifting done at compile step means smaller bundles and faster code
  5. Built in auto-scoped CSS in JS and animations

So it has 5 stars from me, what do you think?

If you like this article, chances are you will also enjoy what I post on Twitter.


Original Link: https://dev.to/alexandrudanpop/a-nice-intro-to-svelte-data-fetching-21np

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To