0.0.3 • Published 8 years ago

redux-player v0.0.3

Weekly downloads
4
License
ISC
Repository
github
Last release
8 years ago

Redux Player

dependencies Status devDependencies Status

Usage

npm i -S redux-player
import { 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 frames

    frames: [
      {
        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

Selectors

  • 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 action next()

  • getCanPrevious(state): get if can trigger action previous()