import { h, Component } from 'preact' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import Player from './components/player.component' import ParamGroup from '../common/paramGroup.component' import Slider from '../common/slider.component' import Select from '../common/select.component' import * as liveActions from './actions' class App extends Component { constructor(props){ super() props.actions.get_params() props.actions.list_checkpoints() props.actions.list_sequences() } componentWillUpdate(nextProps) { console.log('willupdate', nextProps.opt) if (nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) { this.props.actions.list_epochs(nextProps.opt.checkpoint_name) } } render(){ return (
) } } const mapStateToProps = state => ({ opt: state.live.opt, checkpoints: state.live.checkpoints, epochs: state.live.epochs, sequences: state.live.sequences, }) const mapDispatchToProps = (dispatch, ownProps) => ({ actions: bindActionCreators(liveActions, dispatch) }) export default connect(mapStateToProps, mapDispatchToProps)(App)