Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[AsyncSwift] 타다의 상태관리 기법

VCNC
October 18, 2022

[AsyncSwift] 타다의 상태관리 기법

VCNC

October 18, 2022
Tweet

More Decks by VCNC

Other Decks in Technology

Transcript

  1. 2022.09.22 ӣթഅ (ఋ׮ / CTO) ௏যܳ ੜ ׮ܖח ఋ׮੄ ࢚కҙܻ

    ӝࣿ ݽ߄ੌী… Redux э਷ Ѧ ՙলա…?
  2. ݾର 1. RIBs : ఋ׮੄ ইఃఫ୛ 2. ࢚క ҙܻ੄ য۰਍

    ੼ : ఋ׮੄ ா੉झܳ ా೧ 3. ఋ׮੄ ࢚కҙܻ ӝࣿ
  3. State tree Root Main LoggedOut Menu Request Ride LocationEditor Con

    fi rm Re fi nement Coupon DroppedO f Card Matched Pending Viewless Viewful Email, PW, ...
  4. ࢚క ୶оী ٮܲ Ҋ޹ 🤔 • ׮নೠ بݫੋ ݓۅਸ Ҋ۰೧ঠೣ

    • അ੤੄ ਃҳ ઑѤ݅ Ҋ۰ೠ সؘ੉౟੄ Side E ff ect • ৘) ޷ܻߓର ۽૒ী ؀ೠ ੉೧ب হ੉ ࢜۽਍ ௒ সؘ੉౟ೞӝ • ࢚క ੹੉द ଵҊ೧ঠೡ ؘ੉ఠо ݆਺ • ؀੹ઁܳ Ѥܻ٘ח ߸҃ ࢎ೦੉ ࢤӝݶ ցޖ ݆਷ ߸҃ ߊࢤ • ࢲߡ৬ ௿ۄ੉঱౟ р੄ ࢚కо ׮ܳ ٸ زӝചೞח ߑध
  5. ഻ঁ ؊ աই઎૑݅ Ӓېب Ҋ޹਷ ҅ࣘ 🤔 • ࢚కܳ ߈৔ೞח

    ௏٘о ࠙࢑غয ੓਺ • بݫੋ ૑ध ౵ঈ੄ য۰਑ • ࢚క ߸҃ ੉߮౟о Propagate • ৈ۞ RIB ীࢲ ࣻ੿
  6. ࣽࢲ ࠁ੿ Client Side Server Side ݫࣁ૑ ੹׳ ૑ো ߊࢤ

    A ࢚క۽ ੹ജ ਃ୒ A ࢚క۽ ੹ജ ৮ܐ ਽׹ B ࢚క۽ ੹ജೞח RPC ୭ઙ ࢚క A ୭ઙ ࢚క B
  7. ࣽࢲ ࠁ੿ • ఋ׮ীࢲ ࢎਊೞח ࢲߡ ాन : HTTP, gRPC

    • ࢚క সؘ੉౟ਊ ࣽࢲ ࠁ੿ ௏٘ ೙ਃ • DTO ё୓ Versioning • ࢚క সؘ੉౟ ઺ ߸҃ ੉߮౟ ޖदೞӝ
  8. زदࢿ ޙઁ A to A’' B to B’’ A ->

    A’’, B -> B’’ ߸ചܳ زदী ߊࢤदெঠೞ૑݅ A’’ & B ੋ ࢚కо ਫ਼द ઓ੤ೞݴ ߡӒ ߊࢤ
  9. زदࢿ ޙઁ • ೠߣী ߊࢤ೧ঠ ೞח ࢚క সؘ੉౟о ѐ߹۽ ߊࢤ

    • ੉۽ ੋ೧ Event Emit ੉ ࠛ೙ਃೞѱ ৈ۞ߣ ߊࢤ • пп੄ ࢚క সؘ੉౟р рࢼਵ۽ ࢤӝח ޷ޑೠ زदࢿ ߡӒ ೧Ѿਸ ਤೠ ௏٘ ઓ੤ • ੄ب੸ੋ Filter ۽૒
  10. ޙઁ ೧Ѿਸ ਤೠ оࢸ💡 • ࢚క ߸ചী ؀ೠ పझ౟ܳ ੘ࢿೞৈ

    ߸҃ী ؀ೠ উ੿ࢿਸ ٜ݅ݶ ࠂ੟ೠ ࢚క۽ ੋೠ ߡ Ӓо ઴যٜ Ѫ੉׮. • ࢚క ҙܻীࢲ ߈ࠂ੸ਵ۽ աఋաח ಁఢਸ ୶୹ೞৈ ѐߊਸ ೡ ࣻ ੓ب۾ ೞݶ ઺ࠂ ௏ ٘ / ઺ࠂ ߡӒܳ ઴ੌ ࣻ ੓ਸ Ѫ੉׮. • ࢚క ߸ചী ؀ೠ ݽפఠ݂ਸ औѱೡ ࣻ ੓ח ߑߨਸ ٜ݅ݶ ٣ߡӦ ബਯࢿਸ ֫ੌ ࣻ ੓ਸ Ѫ੉׮.
  11. അ੤ ߑध੄ ੢ױ੼ ױ੼ • ҙܻ ஏݶীࢲ য۰਑ • ҙ੼

    ૑ೱ ஹನք౟ (Plugin) ୶о য۰ ਑ • ਬ׫ పझ౟ ੘ࢿ ൨ٝ ੢੼ • ࠗର੸ੋ boilerplate ௏٘ܳ ࢤ࢑ೞ૑ ঋ਺ • ӝמ ѐߊਸ ਤೠ ࡅܲ ࢤ࢑ࢿ
  12. 💡࢚క ҙܻ ଼੐ਸ ة݀ػ ݽٕ۽ ܻ࠙ • ࢚క ߸ച ௏٘ܳ

    ೠҔী ਽૘ • ݆ࣻ਷ ݫࢲ٘ܳ ыח Ѣ؀ೠ ݽٕ੄ ఍ࢤ TODO : Ѣ؀ೠ ݽٕ -> ଼੐ ܻ࠙ա ഛ੢ী ਊ੉ೠ ݽٕ
  13. ׮ܲ ࢤక҅ীࢲח যڌѱ ೞҊ ੓ա? - Redux • ױߑೱ ؘ੉ఠ

    ൒ܴਵ۽ ࢚కܳ ߸҃ ߂ ҳة • Action ୊ܻী ؀ೠ Middleware ܳ ઁҕ • MVI ইఃఫ୛৬ ਬࢎ
  14. ఋ׮ জী Redux झఋੌ ՙলਵݶ…? • State Mutation / Subscription

    ١ Redux ੄ ױߑೱ ؘ੉ఠ ൒ܴ ѐ֛਷ ੉޷ ੊ࣼೠ ࢎਊࢿ • Action җ State ী ؀ೠ Middleware ੄ بੑਸ ాೠ ҙ੼ ૑ೱ ѐߊ оמ • ઺ঔ૘઺ചػ ࢚కҙܻܳ ઁҕ • ழ׮ۆ State Tree ܳ о૑ח ೐۽؋౟ ਃҳࢎ೦ী ੸೤
  15. StateMachine ز੘ җ੿ • StateMachine ਷ State ী ؀ೠ Mutation

    ਸ Action ੉ۄח ؘ੉ఠܳ dispatch ೞৈ ૓೯ • Mutation ਸ ߊࢤ दఃח җ੿ীࢲח Middleware ۄח ઺р੗о ѐੑ • ୭ઙ੸ਵ۽ State ੄ Mutation ਸ दఃח بݫੋ ۽૒਷ Reducer о ଼੐
  16. ബҗ1 - ࢚క ҙܻ ݽٕ ܻ࠙ • ࢚క ҙܻ ଼੐੉

    ೠ Ҕਵ۽ ૘઺ • بݫੋ ૑ध ౵ঈ ਊ੉ • ࠺तೠ ݓۅ੄ ઺ࠂػ ௏٘ ઁѢ • ֬஖ח ۽૒ ѐࢶ -> ੹߈੸ੋ ߡӒ хࣗ
  17. ബҗ2 - Middleware • ҙ੼ ૑ೱ ѐߊ (AOP) • ࠺ૉפझ

    ۽૒ী ৔ೱਸ ޷஖૑ ঋח ز੘ٜ ୶о оמ
  18. ബҗ3 - UnitTest • StateMachine ী ؀ೠ Unit Test оמ

    • ׮নೠ জ ӝמਸ प೯ೞݶࢲ StateTrackerMiddleware ܳ ా೧ п పझ౟ ா੉झܳ ࣻ૘ೞৈ ࠁ׮ औѱ పझ౟ ࢤࢿ оמ
  19. FlipperMiddleware ੄بೞ૑ח ঋও૑݅… • ਗഝೠ ٣ߡӦਸ ਤೠ दпച ో •

    State ੄ di ff ࠺Ү • Dispatch ػ Action ࣽࢲ • ੐੄۽ Action ਸ Dispatch ೞӝ
  20. Wrap up • ࢚క ҙܻ੄ য۰਍ ੼ • উ੿ࢿ :

    ৢ߄ܲ ࢚క ҙܻܳ ਤ೧ࢲ ׮নೠ بݫੋ ૑ध ೙ਃ • ࢤ࢑ࢿ : ߸ചী ਬোೣ ೙ਃ • ೧Ѿߑध • ࢚కҙܻ ଼੐ ݽٕ ܻ࠙ • উ੿੸੉Ҋ ഛ੢ী ਬܻೠ ݽٕ۽ ѐࢶ - Redux style
  21. Wrap up 2 • ইఃఫ୛ ߊ಴ 🙅 • ࢚కҙܻ ݽٕ

    ܻ࠙ • ਬোೞҊ উ੿ࢿ੓ח ࢚కҙܻ ݽٕ ٜ݅ӝ