1.0.2 • Published 6 years ago

redux-media v1.0.2

Weekly downloads
13
License
MIT
Repository
github
Last release
6 years ago

redux-media

Installation

npm install --save redux-media

Import the store enhancer and the reducer

import reduxMedia, { reducer as mediaReducer } from 'redux-media'

Configure

const mediaOptions = {
  isMobile: 'only screen and (max-width: 480px)',
  isTablet: 'only screen and (min-width: 481px) and (max-width: 767px)',
  isDesktop: 'only screen and (min-width: 1025px) and (max-width: 1280px)'
}

Combine the media reducer

const rootReducer = combineReducers({
  ...reducers,
  media: mediaReducer
})

Create the store

const store = createStore(
  rootReducer,
  compose(
    applyMiddleware(...middlewares),
    reduxMedia(mediaOptions)
  )
)
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago