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

https://github.com/starryinternet/tinyco

Simple coroutines using generators
https://github.com/starryinternet/tinyco

Last synced: 11 months ago
JSON representation

Simple coroutines using generators

Awesome Lists containing this project

README

          

# tinyco

[![Build Status](https://travis-ci.org/StarryInternet/tinyco.svg?branch=master)](https://travis-ci.org/StarryInternet/tinyco)

Simple coroutines using generators

---

### Installing

```
npm install --save tinyco
```

---

### Example

```js
'use strict';

const c = require('tinyco');

function asyncAdd( a, b ) {
return new Promise( resolve => setTimeout( () => resolve( a + b ), 100 ) );
}

c(function*() {
let val = yield asyncAdd( 1, 2 );
console.log( val );
});
```