Skip to content
Snippets Groups Projects
Select Git revision
  • starlink-tracker-react
  • master default
2 results

wait.js

Blame
  • once.js 345 B
    'use strict';
    
    const internals = {};
    
    
    module.exports = function (method) {
    
        if (method._hoekOnce) {
            return method;
        }
    
        let once = false;
        const wrapped = function (...args) {
    
            if (!once) {
                once = true;
                method(...args);
            }
        };
    
        wrapped._hoekOnce = true;
        return wrapped;
    };