var createStore = require('redux').createStore
var reducer = require('./reducers/index')

var store = createStore(reducer)

function zero () {
  store.dispatch({ type: 'ZERO', value: Math.round((Math.random()))})
}

function one () {
  store.dispatch({ type: 'ONE', value: Math.round((Math.random()))})
}

document.getElementById('zero')
  .addEventListener('click', function () {
    zero()
  })

document.getElementById('one')
  .addEventListener('click', function () {
    one()
    // setTimeout(function () {
    //    store.dispatch({ type: 'TIMEOUT' })
    //  }, 1000)
  })


var valueEl = document.getElementById('value')
var correctEl = document.getElementById('correct')
var wrongEl = document.getElementById('wrong')
var missedEl = document.getElementById('missed')

function render() {
  valueEl.innerHTML = store.getState().value
  correctEl.innerHTML = store.getState().correct
  wrongEl.innerHTML = store.getState().wrong
  missedEl.innerHTML = store.getState().missed
}


render()
store.subscribe(render)

@@ -121,190 +121,8 @@
 r)%0A%0A
-function zero () %7B%0A  store.dispatch(%7B type: 'ZERO', value: Math.round((Math.random()))%7D)%0A%7D%0A%0Afunction one () %7B%0A  store.dispatch(%7B type: 'ONE', value: Math.round((Math.random()))%7D)%0A%7D%0A%0A
 docu
@@ -200,13 +200,74 @@
     
-zero(
+store.dispatch(%7B type: 'ZERO', value: Math.round((Math.random()))%7D
 )%0A  
@@ -352,115 +352,81 @@
     
-one()%0A    // setTimeout(function () %7B%0A    //    store.dispatch(%7B type: 'TIMEOUT' %7D)%0A    //  %7D, 1000
+store.dispatch(%7B type: 'ONE', value: Math.round((Math.random()))%7D
 )%0A  %7D)%0A%0A
 %0Avar
@@ -421,17 +421,16 @@
 )%0A  %7D)%0A%0A
-%0A
 var valu
@@ -825,17 +825,16 @@
 ssed%0A%7D%0A%0A
-%0A
 render()
@@ -834,16 +834,16 @@
 ender()%0A
+
 store.su
@@ -857,9 +857,8 @@
 (render)
-%0A

clean up index.js