once-component

0.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i once-component

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • tjholowaychuk