1.0.1 • Published 10 years ago

co-once v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

co-once Build Status Coverage Status

Wrap a generator that can be called only once, like _.once.

Install

Install the package with npm:

$ npm install co-once

Usage

once(fn)

var once = require('co-once');
var wrapped = once(getUser);

var user = yield* getUser();
user = yield* getUser(); // result is cached, getUser is only called once

License

MIT

1.0.1

10 years ago

1.0.0

10 years ago