Skip to content

Releases: Mehdi-Zandian/mobile-tech

Async/Await ( Faster Version )

07 Dec 20:50
Compare
Choose a tag to compare

What's new in the Mobile Tech shop?

  • All changes are inside the code and backend , actually, I decided to make a new version of my app with updated fetching methods
    like async/await which is my favorite one.

  • Shorter and smarter code compared to the previous version and of course, it is way faster .

Get Data :

const res = await fetch("address");
const data = await res.json();

XMLHttpRequest

07 Dec 11:20
Compare
Choose a tag to compare

Fetching data method :

In this version , I used an old and obsolete way of fetching data which is XMLHttpRequest

Create a new object of XML

const XML = new XMLHttpRequest();

Open xml

XML.open("GET", "address of api", true);

load xml

XML.onload = function () { if (this.status === 200 && this.readyState === 4) };

send the xml

XML.send();