An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        

react-redux-saga
---

react bindings for [redux-saga](https://github.com/yelouafi/redux-saga/)

kanyewestiskanyebest

```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 redux

render( /* react-dom, etc */

, dom);
}

```

etc
---

- from the work on [redux-react-local](https://github.com/threepointone/redux-react-local)