JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 14737
  • Score
    100M100P100Q130194F
  • License MIT

create a function that can only be invoked once

Package Exports

  • just-once
  • just-once/package.json

Readme

just-once

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-once
yarn add just-once

Create a function that can only be invoked once

import once from 'just-once';

const fn = once(() => console.log('hello'));

fn();
// logs 'hello'
fn();
// does nothing