# yoco

> Create a yoco function from middleware, with flo at the top.

Latest version **1.6.2** (published 2016-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install yoco
pnpm add yoco
yarn add yoco
bun add yoco
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.2 |
| Published | 2016-03-31 |
| First published | 2016-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | flox |

## Links

- npm: https://www.npmjs.com/package/yoco
- Repository: https://github.com/floxjs/yoco
- Homepage: https://github.com/floxjs/yoco#readme
- Issues: https://github.com/floxjs/yoco/issues
- npm.io page: https://npm.io/package/yoco

## Dependencies (7)

- [redux-flo](https://npm.io/package/redux-flo.md) ^2.2.0
- [@f/channel](https://npm.io/package/@f/channel.md) ^1.1.0
- [@f/is-array](https://npm.io/package/@f/is-array.md) ^1.1.1
- [@f/log-error](https://npm.io/package/@f/log-error.md) ^1.0.0
- [@f/map-array](https://npm.io/package/@f/map-array.md) ^1.2.1
- [@f/to-middleware](https://npm.io/package/@f/to-middleware.md) ^1.0.1
- [@f/bind-middleware](https://npm.io/package/@f/bind-middleware.md) ^1.1.1

## Recent versions

- 1.6.2 (latest) — 2016-03-31
- 1.6.1 — 2016-03-31
- 1.5.0 — 2016-03-30
- 1.4.2 — 2016-03-24
- 1.4.1 — 2016-03-22
- 1.4.0 — 2016-03-22
- 1.3.0 — 2016-03-22

## README

# yoco

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Your custom co routines. Use redux middleware to define custom yield behavior, using [redux-flo](//github.com/redux-effects/redux-flo) for control flow.

## Installation

    $ npm install yoco

## Usage

```js
import yoco from 'yoco'
import rlog from 'redux-log'

let arr = []
let log = yoco(rlog(arr))

log(function * () {
  yield 'hello'
  yield 'world'
})

arr // => ['hello', 'world']

```

## API

### yoco(mw)

- `mw` - redux middleware or array of middleware

**Returns:** a custom co routine runner

### map(fns)

- `fns` - functions to perform left to right composition over

**Returns:** a custom co routine runner

```js

import {map} from 'yoco'
let wacky = map(wackify)

wacky(function * () {
  yield 'happy' // => 'wacky happy'
  yield ['dog', 'cat'] // => ['wacky dog', 'wacky cat']
})

function wackify (str) {
  return 'wacky ' + str
}
```

## License

MIT

[travis-image]: https://img.shields.io/travis/floxjs/yoco.svg?style=flat-square
[travis-url]: https://travis-ci.org/floxjs/yoco
[git-image]: https://img.shields.io/github/tag/floxjs/yoco.svg?style=flat-square
[git-url]: https://github.com/floxjs/yoco
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/yoco.svg?style=flat-square
[npm-url]: https://npmjs.org/package/yoco

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