redux-player
v0.0.3
Published
Redux player
Maintainers
Readme
Redux Player
Usage
npm i -S redux-playerimport { reducer as reduxPlayerReducer } from 'redux-player';
export default combineReducers({
reduxPlayer: reduxPlayerReducer
});
Actions
import { actions } from 'redux-player';
or
import { setFrames } from 'redux-player/actions';
setFrames(frames): Initialize the play with an array of framesframes: [ { action: Function, Async function, ... } ]toggleShuffle(): Toggle shuffletoggleLoop(): Toggle loopnext(): Go to next frameprevious(): Go to previous frameplay(): Start playing all framesstop(): Reset play status
Selectors
getFrames(state): get the list of framesgetCurrentFrame(state): get the current frame, which is going to be played nextgetCurrent(state): get the index of the current framegetIsLooping(state): get the looping statusgetIsShuffle(state): get the shuffle statusgetCanNext(state): get if can trigger actionnext()getCanPrevious(state): get if can trigger actionprevious()
