Redux のディレクトリ構成を考える

1bf676e4bd36a48bf616c82d6f52c83a?s=47 sota ohara
February 01, 2018

Redux のディレクトリ構成を考える

1bf676e4bd36a48bf616c82d6f52c83a?s=128

sota ohara

February 01, 2018
Tweet

Transcript

  1. 9.

    component ઃܭ • Container component • react-redux.connect() Λ࢖ͬͯ redux ʹͭͳ͙

    • Presentational component • view ͷΈΛѻ͏ component • react ͷΈͰ׬݁ͤ͞Δ
  2. 20.

    Rails style • rails ͷ scaffold Ͱੜ੒͞ΕΔߏ଄ͱࣅ͍ͯΔ • Redux ͷ

    tutorial ͸͜ͷελΠϧΛ࠾༻ • ໾ׂ͕σΟϨΫτϦ͝ͱʹ෼͔Ε͍ͯΔͷͰΘ͔Γ΍͍͢ • ಉ໊͡લͷϑΝΠϧ͕Ͱ͖ͨΓ͢Δ
  3. 23.

    Domain style • υϝΠϯ͝ͱʹσΟϨΫτϦΛ෼͚ɺͦͷͳ͔ʹ actions ͱ reducers Λͭ͘Δͱ͍͏΋ͷ • actions

    ͱ reducers ͸ 1ର1 Ͱ࡞Δ͜ͱଟ͍ • middleware ͸ configureStore.js Ͱ௥Ճ͢Δ • action types ͸ actions.js ಺ʹॻ͘
  4. 24.
  5. 27.

    Ducks • domain style ʹࣅ͍ͯΔ͕ actions ͱ͔ reducers ͱ͔ΛҰͭͷ ϑΝΠϧʹ·ͱΊͪΌ͏΋ͷ

    • σΟϨΫτϦɺϑΝΠϧ਺͕গͳͯ͘؆ܿ • ҰͭͷϑΝΠϧͷهड़ྔ͕ଟ͘ͳΔ