# redux-online-store-enhancer

> Automatically detect if you are online or online.

Latest version **3.0.0** (published 2017-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-online-store-enhancer
pnpm add redux-online-store-enhancer
yarn add redux-online-store-enhancer
bun add redux-online-store-enhancer
```

## 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 | 3.0.0 |
| Published | 2017-10-11 |
| First published | 2016-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | jurassix |
| Maintainers | jurassix |
| Keywords | online, offline, redux, store, enhancer |

## Links

- npm: https://www.npmjs.com/package/redux-online-store-enhancer
- Repository: https://github.com/jurassix/redux-online-store-enhancer
- Homepage: https://github.com/jurassix/redux-online-store-enhancer#readme
- Issues: https://github.com/jurassix/redux-online-store-enhancer/issues
- npm.io page: https://npm.io/package/redux-online-store-enhancer

## Alternatives

- [@reckona/mreact-store](https://npm.io/package/@reckona/mreact-store.md) — 976 weekly downloads
- [regular-state](https://npm.io/package/regular-state.md) — 410 weekly downloads
- [@pacote/flux-actions](https://npm.io/package/@pacote/flux-actions.md) — 65 weekly downloads
- [@pilotlab/lux-debug](https://npm.io/package/@pilotlab/lux-debug.md) — 39 weekly downloads
- [vue-persist-state](https://npm.io/package/vue-persist-state.md) — 19 weekly downloads

## Recent versions

- 3.0.0 (latest) — 2017-10-11
- 2.0.0 — 2017-03-23
- 1.0.5 — 2016-10-21
- 1.0.4 — 2016-10-20
- 1.0.3 — 2016-10-19
- 1.0.2 — 2016-10-15
- 1.0.1 — 2016-10-15
- 1.0.0 — 2016-10-15

## README

# redux-online-store-enhancer
Automatically detect if you are online or online, in a browser or on a native device.

### Install

```js
yarn add redux-online-store-enhancer
```

### Browser Example

```js
import onlineStoreEnhancer, { onlineReducer } from 'redux-online-store-enhancer';

const reducer = {
  online: onlineReducer,
};

const middleware = [];
const store = createStore(
  reducer,
  compose(
    applyMiddleware(...middleware),
    onlineStoreEnhancer()
  )
);

// get from state directly
const { online } = store.getState();

// reselect
const selectOffline = (state) => state.online;
```

### React Native Example

```js
import { NetInfo } from 'react-native';
import onlineStoreEnhancer, { onlineReducer } from 'redux-online-store-enhancer';

const reducer = {
  online: onlineReducer,
};

const middleware = [];
const store = createStore(
  reducer,
  compose(
    applyMiddleware(...middleware),
    onlineStoreEnhancer(NetInfo)
  )
);

// get from state directly
const { online } = store.getState();

// reselect
const selectOffline = (state) => state.online;
```

Global app state now has a top level, _online_, attribute that will dynamically change as browser goes on and online.

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