Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 401 Bytes

Readme.md

File metadata and controls

24 lines (15 loc) · 401 Bytes

once

Make a function or method callable only once. Useful for initialization methods that may be lazily invoked from several locations, but must only be called once, otherwise the method is a noop.

Installation

$ component install component/once

API

var once = require('once');

Foo.prototype.setup = once(function(){
  // expensive stuff here
});

License

MIT