Photo by Clément H on Unsplash

After take a look at Svelte documentation i was found a brilliant way to using a promise. In this story i’m not talking about comparing performance, i just wanna talk about developer experience.

Developer Experience (DX) is the equivalent to User Experience (UX) when the user of the software or system is a developer.

Let’s say everyone was understand about promises in Javascript. I really shock about implementation of promise in Svelte is very easy! Here is how i create a promise on React. I was create the code as simple as i can and it took more than 20 line of code (i think you have other simplest code).

promise on React

Moving to Svelte, i was amazed that Javascript promise can be combined with HTML and its make code more readable. The line of code can be written less than 15 lines, amazing! We can put resolve and reject on HTML syntax and put with our components.

promise on Svelte

This is one of many reason i support Svelte tobe a powerful Javascript framework because they are thinking out of the box. Really hope many developers can support Svelte to grow faster!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store