https://github.com/threepointone/react-redux-saga
react components for redux-saga
https://github.com/threepointone/react-redux-saga
Last synced: 2 months ago
JSON representation
react components for redux-saga
- Host: GitHub
- URL: https://github.com/threepointone/react-redux-saga
- Owner: threepointone
- Created: 2016-02-13T21:12:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-10T00:29:43.000Z (about 7 years ago)
- Last Synced: 2025-03-18T09:51:37.493Z (2 months ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 67
- Watchers: 2
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
react-redux-saga
---react bindings for [redux-saga](https://github.com/yelouafi/redux-saga/)
```jsx
import {Saga} from 'react-redux-saga';// Saga as a component
// starts running once it mounts
// gets cancelled when it unmounts// you can read redux state / passed props
function* run(getState, {x, y}){
// getState().key.state...
// x === 1
// y === 2
}// alternately, there's a decorator version
@saga(function*(getState, props){
// happy, @sebastienlorber?
})
class App extends Component{
render(){
// ...
}
}```
getting started
---include `` high up in your react tree, and pass it the result of `createSagaMiddleware`. example -
```jsx
let middle = createSagaMiddleware();
let store = createStore(/* reducer */, applyMiddleware(/* ... */, middle)); // from reduxrender( /* react-dom, etc */
, dom);
}```
etc
---- from the work on [redux-react-local](https://github.com/threepointone/redux-react-local)