import Reflux from 'reflux';
import ApplicationActions from '../actions/application-actions'
import Telekomand from '../../lib/telekomand/telekomand';

export default Reflux.createStore({

  init() {
    this.telekomand = {id: undefined, state: undefined}
    this.listenToMany(ApplicationActions)
    Telekomand.on('telekomand.ready', (id) => this.handleTelekomandReady(id))
  },

  getInitialState() {
    return {telekomand: this.telekomand}
  },

  onBootstrap() {
    this.telekomand = Telekomand.info()
    this.trigger({telekomand: this.telekomand})
  },

  handleTelekomandReady(id) {
    this.telekomand.id = id
    this.trigger({telekomand: this.telekomand})
  }

})

@@ -295,91 +295,13 @@
 ns)%0A
-    Telekomand.on('telekomand.ready', (id) =%3E this.handleTelekomandReady(id))%0A
   %7D,%0A
+
 %0A  g
@@ -380,38 +380,33 @@
 otstrap() %7B%0A    
-this.t
+T
 elekomand = Tele
@@ -402,12 +402,14 @@
 mand
- = T
+.on('t
 elek
@@ -418,61 +418,54 @@
 and.
-info()%0A    this.trigger(%7Btelekomand: this.telekomand%7D
+ready', (id) =%3E this.handleTelekomandReady(id)
 )%0A  

fix function undefined; add Telekomand.init to bootstrap handler