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

Graph Theory Behind Immutable JS

João Moura
September 26, 2016

Graph Theory Behind Immutable JS

Talk I presented on Ruby Conf BR 2016, showing how facebook brought one great concept of functional programming to a JS through the same structure used on languages like Scala and Clojure, implementing Graphs to handle with immutability and virtual copies on JS

João Moura

September 26, 2016
Tweet

More Decks by João Moura

Other Decks in Programming

Transcript

  1. Good Developers know how things work. “ ” Steve Souders.

    (O’Reilly Media 2013) Great Developers know why.
  2. ?

  3. a n d r e b e e a an

    and are be bee
  4. a n d r e b e e a an

    and are be bee
  5. a n d r e b e e a an

    and are be bee
  6. a n d r e b e e a an

    and are be bee
  7. a n d r e b e e a an

    and are be bee
  8. IMMUTABLEJS Lists import { List } from "immutable" var list

    = List([1,2,3]) var list2 = list.push(4) list // [1,2,3] list2 === list // false list2 // [1,2,3,4]
  9. IMMUTABLEJS MAP var Immutable = require("immutable"); var map1 = Immutable.Map({

    a: 1, b: 2, c: 3 }); var map2 = map1.set('b', 50); map1.get('b') // 2 map2.get('b') // 50
  10. IMMUTABLEJS Raw JS objects var map1 = Immutable.Map({a: 1}); var

    obj = {b: 2}; var map3 = map1.merge(obj); map3.get('b') // 2
  11. ?