Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emischorr/redux-simple-flash
Simple React/Redux Flash Messages
https://github.com/emischorr/redux-simple-flash
Last synced: 7 days ago
JSON representation
Simple React/Redux Flash Messages
- Host: GitHub
- URL: https://github.com/emischorr/redux-simple-flash
- Owner: emischorr
- License: mit
- Created: 2018-04-11T13:56:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-11T13:57:23.000Z (over 6 years ago)
- Last Synced: 2024-11-08T03:39:16.647Z (about 2 months ago)
- Language: JavaScript
- Size: 4.37 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Redux Simple Flash
A simple flash message plugin for react and redux.## Integration
1 npm install 'redux-simple-flash' --save
2 Add redux-thunk middleware
```
npm install 'redux-thunk' --save
``````javascript
import reduxThunk from 'redux-thunk'const createStoreWithMiddleware = applyMiddleware(reduxThunk)(createStore)
const store = createStoreWithMiddleware()
```3 Add the reducer to your root reducer
```javascript
import { flashReducer } from 'redux-simple-flash'
const rootReducer = combineReducers({
flash: flashReducer
})export default rootReducer
```4 Import and use action creator in your own actions
```javascript
import { addMessage } from 'redux-simple-flash'
...
dispatch(addMessage("success", "User created!"))
...
```