import {createStore} from 'redux'
import {initialState, reducer} from 'store'

import {compose, filter, map} from 'ramda'

import localStorage from 'effects/localStorage'
import log from 'effects/log'
import resize from 'effects/resize'
import seed from 'effects/seed'
import setup from 'effects/setup'
import view from 'effects/view'

const store = createStore(reducer, initialState)

const push = store.dispatch

const effects = [localStorage, log, resize, seed, setup, view]

const listeners = compose(
  filter((listener) => listener != null),
  map((effect) => effect(push)),
)(effects)

let prevState
store.subscribe(
  () => {
    if (prevState !== store.getState()) {
      listeners.forEach((listener) => listener(store.getState()))
      prevState = store.getState()
    }
  }
)

listeners.forEach((listener) => listener(store.getState()))

@@ -11,21 +11,19 @@
 eate
-Store
+App
 %7D from '
 redu
@@ -22,15 +22,23 @@
 om '
-redux
+tessellation
 '%0A
+%0A
 impo
@@ -82,52 +82,8 @@
 e'%0A%0A
-import %7Bcompose, filter, map%7D from 'ramda'%0A%0A
 impo
@@ -295,33 +295,17 @@
 w'%0A%0A
-const store = 
 create
-Store
+App
 (red
@@ -326,471 +326,54 @@
 tate
-)%0A%0Aconst push = store.dispatch%0A%0Aconst effects = %5BlocalStorage, log, resize, seed, setup, view%5D%0A%0Aconst listeners = compose(%0A  filter((listener) =%3E listener != null),%0A  map((effect) =%3E effect(push)),%0A)(effects)%0A%0Alet prevState%0Astore.subscribe(%0A  () =%3E %7B%0A    if (prevState !== store.getState()) %7B%0A      listeners.forEach((listener) =%3E listener(store.getState()))%0A      prevState = store.getState()%0A    %7D%0A  %7D%0A)%0A%0Alisteners.forEach((listener) =%3E listener(store.getState())
+, %5BlocalStorage, log, resize, seed, setup, view%5D
 )%0A

Use library