Skip to content

purposeindustries/co-once

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published