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

Immutable, Performance and Component Communication

Immutable, Performance and Component Communication

React.JS TW fifth meetup

Randy Lien

March 23, 2015
Tweet

More Decks by Randy Lien

Other Decks in Programming

Transcript

  1. Why Immutable? • Immutable data has no side effect! •

    Shared mutable state is the root of all evil 
 - Pete Hunt • You will not get hurt by yourself or someone
  2. Why Immutable? (cont.) • Immutable.js is fast enough and memory

    optimisation • Why Om is faster ? Data or Value is immutable in Clojure/ClojureScript • Immutable + PureRenderMixin
  3. Performance (cont.) • Container Component Pattern • Container Component as

    Data Layer • Data fetching • Component is all about its behaviour • Testing Container or Gallery Container
  4. How to Communicate • Parent - Children • Use Callbacks

    • No relationship • Global event hub • Flux • Codecademy • Adapter, broadcast • Channel (CSP) • Cursor (react-cursor)

  5. Conclusion • Embracing Immutable data for the future (JavaScript) development

    • Componentize your User Interface • Loose coupling your component • Container Component • General Component • You can pick the suitable solution for your needs
  6. FAQ