Skip to content

Commit

Permalink
Added .gitignore, description, Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
geoolekom committed Jun 4, 2017
1 parent d72f229 commit 27de5e8
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
node_modules/
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# redux-store-filler

### Installation

`redux-store-filler` is available on [npm](https://www.npmjs.com/package/redux-store-filler).

```
$ npm install redux-store-filler --save-dev
```

Use it with standard Redux store. For more information, consult the [Redux documentation](http://redux.js.org).

### Simple example of usagei

1. Add config of your entities schema and API.

```js

const schema = {
users: {},
posts: {
author: "users"
},
};

const api = {
users: {
endpoint: "api/v1/users/",
types: ['USERS_GET', 'USERS_SUCCESS', 'USERS_FAILURE'],
},
posts: {
endpoint: "api/v1/posts/",
types: ['POSTS_GET', 'POSTS_SUCCESS', 'POSTS_FAILURE'],
},
};

const config = {
schema,
api,
};

```
2. Create reducer and middleware using this config.
```js
import {config} from './config';
import {configureMiddleware} from 'redux-store-filler';
import {configureReducer} from 'redux-store-filler';
const reducer = configureReducer(config);
const middleware = configureMiddleware(config);
```
3. Use it in your Redux application.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{
"name": "redux-store-filler",
"version": "0.1.0",
"description": "Redux middleware to construct objects from flat data in store.",
"repository": "geoolekom/redux-store-filler",
"homepage": "https://github.com/geoolekom/redux-store-filler",
"description": "Redux middleware to get data via API and put it in redux store.",
"main": "src/index.js",
"author": {
"name": "George Komarov",
"email": "[email protected]"
},
"license": "MIT",
"dependencies": {},
"dependencies": {
"react-addons-update": "^15.5.2",
"redux-api-middleware": "^1.0.3"
},
"devDependencies": {
"react-addons-update": "^15.5.2",
"redux-api-middleware": "^1.0.3"
Expand Down

0 comments on commit 27de5e8

Please sign in to comment.