invoked-once
Invoke a function only once. Useful, depending on situations and especially with initializion.
Installation
npm install --save invoked-once
Usage
const invokedOnce = // a:let j = 1const once = // 2 // 2 // b:let once = //=> Invoked! //=> undefined
Test
Make sure you npm install
to fetch tape:
node test.js
TAP version 13# invokedOnce ok 1 should be equalok 2 should be equalok 3 should be equalok 4 should throwok 5 should throw# should invoke the function once ok 6 should be equivalent 1..6# tests 6 # pass 6 # ok