# @mynewsdesk/promise-saga

> saga util to handle promise as actions

Latest version **1.1.2** (published 2020-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mynewsdesk/promise-saga
pnpm add @mynewsdesk/promise-saga
yarn add @mynewsdesk/promise-saga
bun add @mynewsdesk/promise-saga
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2020-02-06 |
| First published | 2018-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mynewsdesk |
| Maintainers | alexaivars, alexander.rothe, andreaszecher, danielschnee, guusli, joachimlindqvist, josuakoschwitz, katekolosova, marianaalberto, mynewsdesk-dev |

## Links

- npm: https://www.npmjs.com/package/@mynewsdesk/promise-saga
- Repository: https://github.com/mynewsdesk/mnd-javascript
- Homepage: https://github.com/mynewsdesk/mnd-javascript#readme
- Issues: https://github.com/mynewsdesk/mnd-javascript/issues
- npm.io page: https://npm.io/package/@mynewsdesk/promise-saga

## Recent versions

- 1.1.2 (latest) — 2020-02-06
- 1.1.1 — 2020-02-05
- 1.1.0 — 2018-09-04
- 1.0.0 — 2018-09-03

## README

# PromiseSaga

> Util function to return promise results as redux actions

## Releasing
- use `lerna publish` in the parent folder

## Testing
- to run the tests use:
```
yarn test
```
- to rerun test when saving run:
```
yarn test --watch
```
- coverage reports can be shown with:
```
yarn coverage
```

## Documentation

```
import { take, actionChannel } from 'redux-saga/effects';
import createPromiseSaga from '@mynewsdesk/promise-saga';

function* watchFetchUrl() {
  const channel = yield actionChannel('FETCH_URL');
  while (true) {
    const action = yield take(channel);
    const { url } = action.payload;
    yield* createPromiseSaga(
      action,
      fetch,
      url
    )();
  }
}

export default function* sagas() {
  yield [
    watchFetchUrl(),
  ];
}
```

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