Detalhes do pacote

just-once

angus-c68.7kMIT2.2.0

create a function that can only be invoked once

function, once, no-dependencies, just

readme (leia-me)

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

changelog (log de mudanças)

just-once

2.2.0

Minor Changes

  • Rename node module .js -> .cjs

2.1.1

Patch Changes

  • fix: reorder exports to set default last #488

2.1.0

Minor Changes

  • package.json updates to fix #467 and #483