<commit_before># redux-cheerio
Cheerio [middleware](http://rackt.github.io/redux/docs/advanced/Middleware.html) for Redux

##Rationale

#### Parse nearly any HTML or XML document from an API by just dispatching an action.

## Background

Click [here](https://github.com/cheeriojs/cheerio) for more info on Cheerio

## Installation

```
npm install cheerioMiddleware --save
```

To use this piece of middleware, just put it into the middleware chain like you would with any other piece of middleware

## Example

#### configureStore.js

```js
import { createStore, applyMiddleware, combineReducers } from 'redux';
import { apiMiddleware } from 'redux-api-middleware';
import reducers from './reducers';

const reducer = combineReducers(reducers);
const createStoreWithMiddleware = applyMiddleware(apiMiddleware)(createStore);

export default function configureStore(initialState) {
  return createStoreWithMiddleware(reducer, initialState);
}
```

#### app.js

```js
const store = configureStore(initialState);
```

## Usage

To use the middleware, dispatch an action takes the following form.

This object must consist of a url and function that can take
Cheerio tasks must take the following format 

```js<commit_msg>modified readme<commit_after># redux-cheerio
Cheerio [middleware](http://rackt.github.io/redux/docs/advanced/Middleware.html) for Redux

##Rationale

#### Parse nearly any HTML or XML document from an API by just dispatching an action.

## Background

Click [here](https://github.com/cheeriojs/cheerio) for more info on Cheerio

## Installation

```
npm install cheerioMiddleware --save
```

To use this piece of middleware, just put it into the middleware chain like you would with any other piece of middleware

## Example

#### configureStore.js

```js
import { createStore, applyMiddleware, combineReducers } from 'redux';
import cheerioMiddleware from 'redux-cheerio';
import reducers from './reducers';

const reducer = combineReducers(reducers);
const createStoreWithMiddleware = applyMiddleware(cheerioMiddleware)(createStore);

export default function configureStore(initialState) {
  return createStoreWithMiddleware(reducer, initialState);
}
```

#### app.js

```js
const store = configureStore(initialState);
```

## Usage

To use the middleware, dispatch an action takes the following form.

This object must consist of a url and function that can take
Cheerio tasks must take the following format 

```js
{'fraction_non_alphanumeric': 0.09807139926138696, 'fraction_numerical': 0.0, 'mean_word_length': 5.4668435013262595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2507883', 'n_tokens_mistral': 707, 'n_tokens_neox': 696, 'n_words': 248}