npm i -S redux-player
import { reducer as reduxPlayerReducer } from 'redux-player';
export default combineReducers({
reduxPlayer: reduxPlayerReducer
});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 shuffle -
toggleLoop(): Toggle loop -
next(): Go to next frame -
previous(): Go to previous frame -
play(): Start playing all frames -
stop(): Reset play status
-
getFrames(state): get the list of frames -
getCurrentFrame(state): get the current frame, which is going to be played next -
getCurrent(state): get the index of the current frame -
getIsLooping(state): get the looping status -
getIsShuffle(state): get the shuffle status -
getCanNext(state): get if can trigger actionnext() -
getCanPrevious(state): get if can trigger actionprevious()