Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

once.js 199B

123456789101112
  1. 'use strict';
  2. module.exports = function once(fn) {
  3. let called = false;
  4. return function() {
  5. if (called) {
  6. return;
  7. }
  8. called = true;
  9. return fn.apply(null, arguments);
  10. };
  11. };