Kuv puas yuav tsum siv flux lossis Redux?
Kuv puas yuav tsum siv flux lossis Redux?

Video: Kuv puas yuav tsum siv flux lossis Redux?

Video: Kuv puas yuav tsum siv flux lossis Redux?
Video: zam txim tsawg zaus los tsis hloov zoo xyooj 2024, Hlis ntuj nqeg
Anonim

Flux yog tus qauv thiab Redux yog ib lub tsev qiv ntawv. Hauv Redux , lub rooj sib tham yog kom muaj ib lub khw muag khoom ib daim ntawv thov, feem ntau sib cais rau hauv cov ntaub ntawv sau npe sab hauv (koj ua tau tsim ntau tshaj ib Redux khw yog tias xav tau rau ntau qhov xwm txheej nyuaj). Flux muaj ib tug dispatcher thiab tag nrho cov kev ua yuav tsum dhau los ntawm tus dispatcher.

Cov lus nug tseem yog, qhov txawv ntawm Redux thiab flux yog dab tsi?

Qhov tseem ceeb txawv ntawm Flux vs Redux yog tias Flux suav nrog ntau lub khw hauv ib lub app, tab sis Redux suav nrog ib lub Khw rau ib qho app. Txhua qhov kev hloov pauv hauv Redux yog tsim los ntawm ib tug ntshiab muaj nuj nqi hu ua Reducers.

Tsis tas li ntawd, tseem siv flux? Lo lus teb yog feem ntau "Koj tsis siv Flux Tsis tas li ntawd, koj siv Redux "Qhov yuam kev loj uas kuv pom feem ntau yog tias tib neeg siv Redux ua qauv qauv thiab siv lawv tus kheej uni-directional cov ntaub ntawv ntws architectures uas yog raws li "Redux", thaum tseeb nws tsis muaj dab tsi tab sis lwm tus. Flux kev siv.

Ib tug kuj nug, puas yog Facebook siv flux lossis Redux?

Tom qab React tawm los, facebook pom tau hais tias lawv xav tau ib txoj hauv kev kom paub tab tswj lub xeev, yog li ntawd lawv tsim lub flux architecture. Redux yog a flux kev siv. Txij li thaum facebook tsim flux , mas ua tsis tsim redux . Lawv feem ntau yuav siv flux.

Kuv puas yuav tsum siv Redux?

Feem ntau, siv Redux thaum koj muaj qhov tsim nyog ntawm cov ntaub ntawv hloov pauv lub sijhawm, koj xav tau ib qho ntawm qhov tseeb, thiab koj pom tias txoj hauv kev zoo li khaws txhua yam nyob rau theem siab tshaj React tivthaiv lub xeev tsis txaus. Txawm li cas los xij, nws tseem ceeb heev kom nkag siab qhov ntawd siv Redux los nrog kev sib pauv.

Pom zoo: