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

Introducing React.js and Redux

Introducing React.js and Redux

イドバタ会議第一回(2016年6月29日 @ 塩尻インキュベーションプラザ)でのプレゼンテーション

Ryosuke Goto

June 29, 2016
Tweet

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ SELF INTRODUCTION ޙ౻ ྑีʢ͝ͱ͏ Γΐ͏͚͢ʣ 1975೥ ௗऔݝถࢠࢢੜ·Εɺ෱ౡݝ෱ౡࢢҭͪ
 
 5೥લʹ౦ژ͔Βদຊ΁ɺݱࡏদຊࢢԬాԼԬాࡏॅ


    7ࡀͷࢠڙʢখֶ2೥ੜͷஉͷࢠʣ͕͍·͢
 σΟϨΫγΦגࣜձࣾ ʢ҆ಶ໺ࢢ๛ՊʣͷΤϯδχΞ
 
 ϑϩϯτΤϯυ͸React.js
 REST APIͳͲͷόοΫΤϯυ͸PythonͰॻ͍ͯ·͢
  2. As developers, we are expected to handle optimistic updates, server-side

    rendering, fetching data before performing route transitions, and so on. We find ourselves trying to manage a complexity that we have never had to deal with before,
 ʮ։ൃऀͰ͋Ε͹ɺଈ࣌ߋ৽ɺαʔόʔαΠυϨϯμϦϯάɺը໘ભ Ҡલͷσʔλಉظͱ͔ɺ৭ʑͳ͜ͱΛظ଴͞ΕΔΑͶɻ͜Ε·Ͱʹ ͳ͔ͬͨΑ͏ͳෳࡶ͞ΛɺͲ͏ʹ͔͠ͳ͖Ό͖Ό͍͚ͳ͍Α͏ʹͳͬ ͯΔɻʯʢfrom redux.js.org )
  3. body div div div h1 ul li li a ߋ৽ʂ

    ͑ʔͬͱɺulͷதͷ2൪ΊͷliΛ
 ߋ৽ͯ͠ɺͬͱɻ
  4. body div div div h1 ul li li a ͑ʁҧͬͨ!?

    
 ΋͏৽͍͠σʔλདྷͨʁ
 ΍ͬͺ3൪Ίͷliʁ li $.ajax()
  5. body div div div h1 ul li li a component

    1. ͳΜͱͳ͘ ߋ৽ ίϯϙʔωϯτͬͯ΍ͭʹ
 ʮߋ৽͍ͨ͠ʯͬͯ఻͑Δͱ͍͍Α
  6. body div div div h1 ul li li a component

    1. ͳΜͱͳ͘ ߋ৽ 2. ࣗಈͰ ॻ͖׵͑ ίϯϙʔωϯτͬͯ΍ͭʹ
 ʮߋ৽͍ͨ͠ʯͬͯ఻͑Δͱ͍͍Α
  7. 3. શͯpureؔ਺ʹΑͬͯมߋ ʢChanges are made with pure functions) ͲͷΑ͏ʹΞϓϦέʔγϣϯͷঢ়ଶʢstate treeʣ͕ʮΞΫγϣϯʯͰมΘͬͯ

    ͍͔͘Λɺ७ਮؔ਺Ͱهड़ɹˠ ͦΕΒ͸ʮreducerʯͱݺ͹ΕΔ • ʮreducerʯ͸ঢ়ଶͱΞΫγϣϯΛड͚ͯɺ৽͍͠ঢ়ଶΛฦؔ͢਺ɻ • ݱࡏͷstateΦϒδΣΫτΛมߋͤͣʹɺ৽͍͠stateΦϒδΣΫτΛ࡞Δɻ • ίʔυͷن໛ʹԠͯ͡ɺػೳ͝ͱʹreducerΛෳ਺࡞͍ͬͯ͘