Skip to content

Commit

Permalink
down with decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
thabti committed Nov 15, 2016
1 parent 20bce04 commit 0d40584
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions src/components/Audioplayer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,7 @@ import Track from './Track';

const styles = require('./style.scss');

@connect(
state => ({
file: state.audioplayer.file,
surahs: state.surahs.entities,
qari: state.audioplayer.qari,
qaris: state.audioplayer.qaris,
surah: state.audioplayer.surah,
progress: state.audioplayer.progress,
duration: state.audioplayer.duration,
currentTime: state.audioplayer.currentTime,
isPlaying: state.audioplayer.isPlaying,
shouldRepeat: state.audioplayer.shouldRepeat,
surahPage: state.audioplayer.surahPage,
shouldContinuous: state.audioplayer.shouldContinuous,
shouldRandom: state.audioplayer.shouldRandom,
}),
{ load, play, pause, playPause, update, repeat, next, previous, continuous, random }
)
export default class Audioplayer extends Component {
class Audioplayer extends Component {
static propTypes = {
load: PropTypes.func.isRequired,
surahs: PropTypes.object.isRequired,
Expand Down Expand Up @@ -299,3 +281,23 @@ export default class Audioplayer extends Component {
);
}
}


export default connect(
state => ({
file: state.audioplayer.file,
surahs: state.surahs.entities,
qari: state.audioplayer.qari,
qaris: state.audioplayer.qaris,
surah: state.audioplayer.surah,
progress: state.audioplayer.progress,
duration: state.audioplayer.duration,
currentTime: state.audioplayer.currentTime,
isPlaying: state.audioplayer.isPlaying,
shouldRepeat: state.audioplayer.shouldRepeat,
surahPage: state.audioplayer.surahPage,
shouldContinuous: state.audioplayer.shouldContinuous,
shouldRandom: state.audioplayer.shouldRandom,
}),
{ load, play, pause, playPause, update, repeat, next, previous, continuous, random }
)(Audioplayer);

0 comments on commit 0d40584

Please sign in to comment.