   toggleTodo: (id) -> @dispatch constants.TOGGLE_TODO, id:   id
   clearTodos:      -> @dispatch constants.CLEAR_TODOS
 
+# Instantiating our stores
+
+stores =
+  TodoStore: new TodoStore
+
 # Creation of a Flux instance
 
-stores = { TodoStore: new TodoStore }
 flux = new Fluxxor.Flux(stores, actions)
 
 # Logging upon the "dispatch" event

                 constants.CLEAR_TODOS, @onClearTodos)

  onAddTodo: (payload) ->
    id = @_nextTodoId()
    todo =
      id:       id
      text:     payload.text
      complete: false

    @todos[id] = todo
    @emit 'change'


  # Its style will be determined based on the completion state.
  render: ->
    style =
      textDecoration:
        if @props.todo.complete then "line-through" else ""

    <span style={style} onClick={@onClick}>
      {@props.todo.text}
    </span>

  # Clicking on a todo item will toggle the completion state.
  onClick: ->
    @getFlux.actions.toggleTodo(@props.todo.id)

# Rendering the whole component
document.addEventListener 'DOMContentLoaded', (e) ->
  React.render <Application flux={flux}/>,
                document.getElementById('react_mountPoint')
