$ = jQuery context = window logger = context.JK.logger SessionActions = @SessionActions JamBlasterActions = @JamBlasterActions #window.StupidCallback: () => # alert("STUPID CALLBACK") @CallbackStore = Reflux.createStore( { init: () -> # Register with the app store to get @app this.listenTo(context.AppStore, this.onAppInit) onAppInit: (@app) -> if context.jamClient.RegisterGenericCallBack? console.log("REGISTERING GENERIC CALLBACK") context.jamClient.RegisterGenericCallBack('CallbackStore.onGenericCallback') #context.jamClient.RegisterGenericCallBack('StupidCallback') onGenericCallback: (map) -> console.log("GENERIC CALLBACK CALLED: ", map) if map.cmd == 'join_session' SessionActions.joinSession(map['music_session_id']) else if map.cmd == 'client_pair_state' JamBlasterActions.pairState(map) else if map.cmd == 'jamblaster_tracks_updated' JamBlasterActions.jamblasterTracksUpdated() } )