title: MVC / Observer & Immutable Data Structures
body: <p>Can You please explain what are analogues of MVC / Observer techniques in two cases:</p>
  
  <ol>
  <li>Immutable Objects (OOP style)</li>
  <li>Immutable Data (functional style)</li>
  </ol>
  
  <p>For example let's consider following simple GUI example (You can try it live here <a href="http://tinkerbin.com/0XDHRXIl" rel="nofollow">http://tinkerbin.com/0XDHRXIl</a> click 'Run' button to start it and wait 2 sec for text to appear)</p>
  
  <p>It's built with JavaScript because it's easy to play and MVC / Observer are very natural to it</p>
  
  <pre><code>// Model containing the data.
  var Post = Backbone.Model.extend({}) 
  
  var PostView = Backbone.View.extend({
    initialize: function() {
      // Registering view rendering method as
      // an observer on the model.
      this.model.on('all', this.render.bind(this))
    },  
    // Every time state of model changes 
    // this method will be called.
    render: function() {
      // Printing value of model.text attriubute. 
      this.$el.html(this.model.get('text'))
      return this
    }
  })
  
  // Now, any time the model is updated the view will be also 
  // automatically updated.
  post.set({text: "hello, it's me"})
  </code></pre>
  
  <p>But I don't quite understand how to do the same with Immutable OOP and Functional styles, what ways are there?</p>