Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Jefreesujit committed Dec 26, 2018
1 parent 9a6cb75 commit df99108
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ npm i react-context-redux --save
Or use it with a specific version you need

```
<script src="https://unpkg.com/react-context-redux@0.2.1/umd/react-context-redux.min.js" crossorigin></script>
<script src="https://unpkg.com/react-context-redux@0.3.0/umd/react-context-redux.min.js" crossorigin></script>
```

## Usage
Expand All @@ -35,6 +35,15 @@ export const { Provider, connect } = createStore({ // pass your initial state
});
```

It has middleware support too, works the same way as how redux middleware works. Just import `applyMiddleware`, include your favorite middlewares as parameters and pass it to `createStore`, and it will work like a charm.

```js
import { createStore, applyMiddleware } from 'react-context-redux';
import logger from 'redux-logger';

const { Provider, connect } = createStore({someState: 'value'}, applyMiddleware(logger));
```

**App.js:**
```js
import React from 'react';
Expand Down

0 comments on commit df99108

Please sign in to comment.