/** * Root level application **/ import React, { PropTypes } from 'react'; import ReactDOM from 'react-dom'; import { createStore, bindActionCreators } from 'redux' import { Link } from 'react-router' import { connect } from 'react-redux' import * as actions from '../actions/index' import Services from '../services/Services' class App extends React.Component{ constructor(props){ super(props); this.handleClick = this.handleClick.bind(this); } handleClick(){ console.log('click'); //this.props.providerActions.authorizeSpotify(); Services.get('services.mopidy') .then( function(MopidyService){ MopidyService.connection.playback.getState() .then( function(state){ console.log('App.js > playback state', state); }); }) } componentDidMount(){ Services.get('services.mopidy') .then( function(MopidyService){ MopidyService.connection.playback.getState() .then( function(state){ console.log('App.js > playback state', state); }); }) } render(){ return (
{this.props.children}
); } } /** * Export our component * * We also integrate our global store, using connect() **/ const mapStateToProps = (state, ownProps) => { return state; } const mapDispatchToProps = (dispatch) => { return { actions: bindActionCreators(actions, dispatch) } } export default connect(mapStateToProps, mapDispatchToProps)(App)