# coback

> Creates standard callbacks which have a yieldable component, allowing you to pass them as a traditional callback, but yield on them later.

Latest version **1.0.0** (published 2014-08-18) · MIT license · 0 weekly downloads

## Install

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

## 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.0.0 |
| Published | 2014-08-18 |
| First published | 2014-08-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Bret Copeland |
| Maintainers | bretcope |
| Keywords | co, thunk, callback, yield |

## Links

- npm: https://www.npmjs.com/package/coback
- Repository: https://github.com/bretcope/coback
- Issues: https://github.com/bretcope/coback/issues
- npm.io page: https://npm.io/package/coback

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2014-08-18

## README

# coback

Occasionally you find yourself in a position where thunks don't quite work, such as:

```js
var obj = new FakeObject(callback);
obj.doSomething();
obj.execute(); // now... how do I yield on the callback at this step?
```

Coback solves that by creating a callback which can be passed to traditional-style functions, but still yielded on at a later time.

```js
var coback = require('coback');

// just call coback to create the callback function
var callback = coback();

// pass the callback to your function/constructor
var obj = new FakeObject(callback);
obj.doSomething();
obj.execute();

// when you're ready to wait for the result, yield on the result property
var result = yield callback.result;
```

Built to work with [co](https://github.com/visionmedia/co) but likely works with other frameworks.

## Install

    npm install coback

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