Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 16 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,39 @@ Better Documentation: [http://posabsolute.github.io/redux-flash-notification](ht

## Integration

**1** Install it
```
npm install react-redux-flash-notification --save
```

1 npm install 'flash-notification-react-redux' --save

2 Add redux-thunk middleware
**2** Add thunk middleware
```
npm install 'redux-thunk' --save
npm install redux-thunk --save
```

```javascript
import reduxThunk from 'redux-thunk'
import thunk from 'redux-thunk'

const createStoreWithMiddleware = applyMiddleware(reduxThunk)(createStore);
const store = createStoreWithMiddleware()
const store = createStore(rootReducer, applyMiddleware(thunk));
```

3 Add the reducer to your root reducer
**3** Add the reducer to your root reducer

```javascript

import { GrowlerReducer } from 'flash-notification-react-redux';
import { GrowlerReducer as growler } from 'react-redux-flash-notification';

const rootReducer = combineReducers({
growler: GrowlerReducer,
growler,
});

export default rootReducer;
```

4 Add the growler component to your app root component so it is always accessible
**4** Add the growler component to your app root component so it is always accessible

```javascript
import { GrowlerContainer } from 'flash-notification-react-redux';
import { GrowlerContainer } from 'react-redux-flash-notification';

export class App extends Component {
static propTypes = {
Expand All @@ -54,29 +56,7 @@ export class App extends Component {
}
```

5 Add webpack loaders to load es6 files.
```javascript
module: {
loaders: [{
test:[/\.jsx$/, /\.js$/],
loader: 'babel',
query: {
plugins: ['transform-decorators-legacy']
},
include: [
path.resolve(__dirname, "src"),
path.resolve(__dirname, "node_modules/flash-notification-react-redux")
],
}, {
test: [/\.scss$/, /\.css$/],
loader: 'css?localIdentName=[path]!postcss-loader!sass',
}],
},
};
```

6 You're done.

**5** You're done.

## Usage

Expand Down Expand Up @@ -203,4 +183,4 @@ Time the growler is shown in milliseconds

## Limitations

This component is based on the use of redux, react, es6 & es7 (decorators) and webpack for loading the css as an import module.
Does not support Server Side Rendering.
Loading