Modern Full-Stack Development



Download 5,64 Mb.
Pdf ko'rish
bet59/107
Sana06.08.2021
Hajmi5,64 Mb.
#140576
1   ...   55   56   57   58   59   60   61   62   ...   107
Bog'liq
Modern Full-Stack Development Using TypeScript, React, Node

onDownloadProgress – This is a function to be called periodically 
while a response is downloading, allowing you the ability to show a 
progress bar or spinner or similar UI element (you can do this with 
onUploadProgress in the opposite direction too).
Axios is a very robust but extremely simple-to-use library that, for me, is the obvious 
choice for our server communication needs in MailBag.
 Mirroring the Server Part 1: Contacts.ts
The first Worker class we’re going to talk about is in the Contacts.ts file, which, of 
course, means we’re dealing with the Contacts Worker class. But, even before the Worker 
class, we find that we have an interface present:
export interface IContact {
  _id?: number, name: string, email: string
}
If you look back at the Contacts.ts file on the server side, you’ll find this same 
interface. That should make sense to you: after all, we’re passing objects back and forth 
that need to have the same structure on both sides of the conversation!
After that, the Worker class begins:
export class Worker {
Nothing special there, and again identical to the server. Within the Worker, we find a 
series of methods, beginning with listContacts().
Chapter 9   Delivering the gooDs: MailBag, the Client


243

Download 5,64 Mb.

Do'stlaringiz bilan baham:
1   ...   55   56   57   58   59   60   61   62   ...   107




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish