# redux-thaga

> Like redux-saga like redux-thunk

Latest version **0.1.0** (published 2016-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-thaga
pnpm add redux-thaga
yarn add redux-thaga
bun add redux-thaga
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2016-03-14 |
| First published | 2016-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Galkin Rostislav |
| Maintainers | galkinrost |
| Keywords | redux, react, reactjs, redux-saga, redux-thunk, middleware |

## Links

- npm: https://www.npmjs.com/package/redux-thaga
- Repository: https://github.com/babotech/redux-thaga
- Homepage: https://github.com/babotech/redux-thaga#readme
- Issues: https://github.com/babotech/redux-thaga/issues
- npm.io page: https://npm.io/package/redux-thaga

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2016-03-14
- 0.0.1 — 2016-03-14

## README

# redux-thaga [![Build Status](https://travis-ci.org/babotech/redux-thaga.svg?branch=master)](https://travis-ci.org/babotech/redux-thaga)

To not choose between [redux-thunk](https://github.com/gaearon/redux-thunk) and [redux-saga](https://github.com/yelouafi/redux-saga)

## Installation

```
npm install --save redux-thaga
```

## Integration 

```javascript
...
import * as sagas from './sagas'
import createThagaMiddleware from 'redux-thaga'

const thaga = createThagaMiddleware(sagas)

const createStoreWithMiddlewares = applyMiddleware(thaga)(createStore)

...
```

## Usage

Like thunk for async actions

```javascript
export const asyncActionCreator = () => (dispatch, getState) => {
    dispatch({
        type: `REQUEST`
    })
    
    request()
        .then(() => 
            dispatch({
                type: `SUCCESS`
            })
        )
}

```

Like saga

```javascript
import {on} from 'redux-thaga'

export const onSomeAction = on(`SOME_ACTION_TYPE`, (dispatch, getState, action) => {
    request()
        .then(() => {
            dispatch({
                    type: `ANOTHER_ACTION_TYPE`
                })
        })
})

```

## License

**MIT**

---
_Source: https://npm.io/package/redux-thaga · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
