@podlove/player-state
v6.1.0-alpha.1
Published
Reducers for Podlove Player Framework
Downloads
193
Readme
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.