# subscription-container

> A react component that dispatches start and stop redux actions to drive a meteor subscription

Latest version **0.0.3** (published 2016-11-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install subscription-container
pnpm add subscription-container
yarn add subscription-container
bun add subscription-container
```

## Health

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

Positive: no vulnerabilities.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2016-11-13 |
| First published | 2016-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kyle Chamberlain; |
| Maintainers | koleok |
| Keywords | component, react-component, react |

## Links

- npm: https://www.npmjs.com/package/subscription-container
- Repository: https://github.com/koleok/subscription-container
- Issues: https://github.com/koleok/subscription-container/issues
- npm.io page: https://npm.io/package/subscription-container

## Dependencies (2)

- [react-redux](https://npm.io/package/react-redux.md) ^4.4.5
- [meteor-redux-middlewares](https://npm.io/package/meteor-redux-middlewares.md) github:koleok/meteor-redux-middlewares#temp-install

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2016-11-13
- 0.0.1 — 2016-11-13

## README

# subscription-container [![npm](https://img.shields.io/npm/v/subscription-container.svg?style=flat-square)](https://www.npmjs.com/package/subscription-container)

[![CircleCI](https://img.shields.io/circleci/project/koleok/subscription-container.svg?style=flat-square&label=nix-build)](https://circleci.com/gh/koleok/subscription-container)
[![Coverage](https://img.shields.io/codecov/c/github/koleok/subscription-container.svg?style=flat-square)](https://codecov.io/github/koleok/subscription-container?branch=master)
[![Dependencies](https://img.shields.io/david/koleok/subscription-container.svg?style=flat-square)](https://david-dm.org/koleok/subscription-container)
[![Dev Dependencies](https://img.shields.io/david/dev/koleok/subscription-container.svg?style=flat-square)](https://david-dm.org/koleok/subscription-container#info=devDependencies)

A react component that dispatches start and stop redux actions to drive a meteor subscription

## Installation

### NPM
```sh
npm install --save react subscription-container
```

Don't forget to manually install peer dependencies (`react`) if you use npm@3.

### 1998 Script Tag:
```html
<script src="https://unpkg.com/react/dist/react.js"></script>
<script src="https://unpkg.com/subscription-container/build/subscription-container.js"></script>
(Module exposed as `SubContainer`)
```

## Demo

[http://koleok.github.io/subscription-container](http://koleok.github.io/subscription-container)

## Usage
```js
import React from 'react';
import ReactDOM from 'react-dom';
import { SubContainer } from 'subscription-container';
import { Provider } from 'react-redux';

import Posts from './Posts';
import store from './store';
import { Meteor } from 'meteor/meteor'

const App = () => (
  <Provider store={store}>
    <SubContainer meteor={Meteor} collection={Posts} subscriptionKey="Posts.all">
      {/* Any ol thing */}
    </SubContainer>
  </div>
);

const appRoot = document.createElement('div');
document.body.appendChild(appRoot);
ReactDOM.render(<App />, appRoot);
```

## Options

```js
// TODO
```

## Development and testing

Currently is being developed and tested with the latest stable `Node 6` on `OSX`.

To run example covering all `SubContainer` features, use `npm start dev`, which will compile `src/example/Example.js`

```bash
git clone git@github.com:koleok/subscription-container.git
cd subscription-container
npm install
npm start dev

# then
open http://localhost:8080
```

## Tests

```bash
# to run tests
npm start test

# to generate test coverage (./reports/coverage)
npm start test.cov

# to run end-to-end tests
npm start test.e2e
```

## License

MIT

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