Dab tsi yog qhov tshwm sim tshwm sim?
Dab tsi yog qhov tshwm sim tshwm sim?

Video: Dab tsi yog qhov tshwm sim tshwm sim?

Video: Dab tsi yog qhov tshwm sim tshwm sim?
Video: Nyiaj yog dab tsi ? thiab tshwm π’”π’Šπ’Ž 𝒒𝒉𝒐𝒗 π’•π’˜π’ˆ 𝒍𝒐𝒔 ? £€Β₯β‚©$ πŸ’²πŸ’ΉπŸ’±πŸ’ΈπŸ’·πŸ’ΆπŸ’΅πŸ’΄ 29/09/2021 2024, Kaum ib hlis
Anonim

A " kev mob tshwm sim "yog ib yam dab tsi uas cuam tshuam rau ib yam dab tsi sab nraud ntawm qhov kev ua haujlwm raug tua. Cov haujlwm uas ua tsis tau kev mob tshwm sim yog hu ua "pure" functions: lawv coj nyob rau hauv kev sib cav, thiab lawv rov qab muaj nuj nqis. Tsis muaj dab tsi ntxiv tshwm sim thaum ua haujlwm.

Hais txog qhov no, dab tsi tshwm sim hauv Redux?

Common nta ntawm sab - teebmeem Piv txwv li, thaum tus neeg siv nyem "Txuag," koj yuav xav tua AJAX thov. Sab - teebmeem muaj xa Redux kev ua. Zoo li thaum cov txheej txheem txuag tiav tiav, koj tuaj yeem xav xa SAVE_SUCCEEDED; los yog thaum nws ua tsis tiav, SAVE_FAILED. Lawv kuj yuav tsis xa dab tsi.

Ib tug kuj yuav nug, yog vim li cas hook react? β€œ Hooks yog ib qho tshiab ntxiv rau Teb hauv version 16.8 uas tso cai rau koj siv lub xeev thiab lwm yam Teb nta, zoo li cov txheej txheem lifecycle, tsis sau ib chav kawm. Hooks cia koj ib txwm siv lub luag haujlwm tsis tas yuav hloov pauv ntawm cov haujlwm, cov chav kawm, cov khoom siv siab dua, thiab ua cov khoom siv.

Ib yam li ntawd, koj tuaj yeem nug, dab tsi yog kev phiv hauv Javascript?

Cov teebmeem A kev mob tshwm sim yog ib qho kev hloov pauv hauv lub xeev uas tuaj yeem pom sab nraum lub npe hu ua haujlwm uas tsis yog nws cov nqi rov qab. Kev mob tshwm sim suav nrog: Hloov kho ib qho kev sib txawv sab nraud lossis cov khoom vaj khoom tsev (piv txwv li, lub ntiaj teb sib txawv, lossis qhov sib txawv ntawm cov niam txiv muaj nuj nqi cov saw hlau)

Puas yog React Hooks zoo?

TL; DR: Hooks yog Zoo heev , tab sis Tsis yog. Hloov chaw, nws txhim kho API rau tej yam uas peb tuaj yeem ua nrog Teb . Txawm li cas los xij, lub nuv API tau ua cov neeg hauv zos Teb xeev API siv tau ntau dua, thiab vim tias nws yooj yim dua li cov qauv hauv chav kawm nws hloov, Kuv siv cov khoom hauv xeev ntau dua li kuv tau siv thaum nws tsim nyog.

Pom zoo: