@podlove/player-state

6.0.1-alpha.7 • Public • Published

Player State

Player Reducer and Selectors creating the state, created with redux-actions

Reducers

Each state slice provides a reducer function, that can be used to create the store:

import { combineReducers } from 'redux'

import { reducer as runtime } from '@podlove/player-state/runtime'
import { reducer as theme } from '@podlove/player-state/theme'

export default combineReducers({
  runtime,
  theme
})

Depending on the application use case only a specific set of reducers can be used and arbitrary combined.

Selectors

A selector is a function that provides access to a specific state property without the need to know the specific state structure:

import { selectors as runtime } from '@podlove/player-state/runtime'
import { compose } from 'ramda'

import root from './root'

export default {
  language: compose(
    runtime.language,
    root.runtime
  ),
  platform: compose(
    runtime.platform,
    root.runtime
  )
}

Depending on the application use case and the state structure only a specific set of selectors are needed.

Readme

Keywords

none

Package Sidebar

Install

npm i @podlove/player-state

Weekly Downloads

2

Version

6.0.1-alpha.7

License

MIT

Unpacked Size

112 kB

Total Files

98

Last publish

Collaborators

  • minus0
  • alexander-heimbuch