     DocumentComponent = React.createClass
       displayName: 'DocumentComponent'
       mixins: [React.ComponentListMixin]
+      getInitialState: ->
+        unsubscribe: @props.cells_model.onValue @set_cells
       render: ->
         React.DOM.div {className: 'document'}, @state.components
       # FIXME #163 can't call this

        # reset the file picker so change is triggered again
        $file_picker.val ''

      document = DocumentComponent()
      # FIXME add file picker
      notebook =
        cells: []
        input_number: 1
        output_number: 1
        component: document

      notebook

    update_view = (notebook) ->
      notebook.cells_model.set notebook.cells.slice()

    clear_notebook = (notebook) ->
      for cell in notebook.cells
