# redux-effects-media

> Effect driver for listening to media query changes in javascript

Latest version **1.0.2** (published 2016-11-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-effects-media
pnpm add redux-effects-media
yarn add redux-effects-media
bun add redux-effects-media
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-11-03 |
| First published | 2016-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | ashaffer88 |

## Links

- npm: https://www.npmjs.com/package/redux-effects-media
- Repository: https://github.com/redux-effects/redux-effects-media
- Homepage: https://github.com/redux-effects/redux-effects-media#readme
- Issues: https://github.com/redux-effects/redux-effects-media/issues
- npm.io page: https://npm.io/package/redux-effects-media

## Dependencies (2)

- [@f/foreach-obj](https://npm.io/package/@f/foreach-obj.md) ^1.1.1
- [matchmedia-polyfill](https://npm.io/package/matchmedia-polyfill.md) ^0.3.0

## Recent versions

- 1.0.2 (latest) — 2016-11-03
- 1.0.1 — 2016-09-13
- 1.0.0 — 2016-06-09

## README

# redux-effects-media

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

Effect driver for listening to media query changes in javascript

## Installation

    $ npm install redux-effects-media

## Usage

You can setup actions to be dispatched whenever the status of a media query changes, like this:

```javascript
import {watchMedia} from 'redux-effects-media'
import createAction from '@f/create-action'
import {dispatch} from './store'

const mediaChanged = createAction('Media query changed')

dispatch(watchMedia({
  portrait: '(orientation: portrait)'
  landsacpe: '(orientation: landscape)'
}), mediaChanged)
```

Anytime one of the media queries in your keyed map changes the action creator specified in the second parameter will have its action dispatched with a payload of the form `{key, matches}`, where the key is the name you gave that query in your object, and `matches` is whether or not the query is currently matching.

## License

MIT

---
_Source: https://npm.io/package/redux-effects-media · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
