// @flow
import React from 'react'
import ReactDOM from 'react-dom'
import { Dispatcher, Context } from 'almin'
import AppStoreGroup from './store/AppStoreGroup'
import SearchApp from './SearchApp'
import LazyLoadApp from './LazyLoadApp'
import { registerWorkers } from './ServiceWorker'
import swPrecacheConfig from '../../sw-precache-config'

// --- Init SearchApp
const dispatcher = new Dispatcher()
const appContext = new Context({
  dispatcher,
  store: AppStoreGroup.create()
})

if (process.env.NODE_ENV !== 'production') {
  const { AlminLogger } = require('almin-logger')
  const logger = new AlminLogger()
  logger.startLogging(appContext)
}

ReactDOM.render(<SearchApp appContext={appContext} />, document.getElementById('search'))

// --- Init LazyLoadApp
LazyLoadApp(document.querySelectorAll('.markdown img'))

// --- Init ServiceWorker
registerWorkers([
  swPrecacheConfig.swFile
])

// @flow
import React from 'react'
import ReactDOM from 'react-dom'
import { Dispatcher, Context } from 'almin'
import AlminLogger from 'almin-logger'
import AppStoreGroup from './store/AppStoreGroup'
import SearchApp from './SearchApp'
import LazyLoadApp from './LazyLoadApp'
import { registerWorkers } from './ServiceWorker'
import swPrecacheConfig from '../../sw-precache-config'

// --- Init SearchApp
const dispatcher = new Dispatcher()
const appContext = new Context({
  dispatcher,
  store: AppStoreGroup.create()
})

if (process.env.NODE_ENV !== 'production') {
  const logger = new AlminLogger()
  logger.startLogging(appContext)
}

ReactDOM.render(<SearchApp appContext={appContext} />, document.getElementById('search'))

// --- Init LazyLoadApp
LazyLoadApp(document.querySelectorAll('.markdown img'))

// --- Init ServiceWorker
registerWorkers([
  swPrecacheConfig.swFile
])

Fix `AlminLogger is not constructor`
:bug: Fix `AlminLogger is not constructor`
