Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@supertenant/core / src / util / atMostOnce.js
Size: Mime:
// (c) Copyright 2023 Supertenant Ltd. - all rights reserved.
// See LICENSE file in project root for license terms.
"use strict";let logger;logger=require("../logger").getLogger("util/atMostOnce",newLogger=>{logger=newLogger}),module.exports=function(name,cb){let callCount=0;return function(){if(1===++callCount)return cb.apply(null,arguments);logger.debug("Function %s was called %s times. This time with the following arguments.",name,callCount,{args:Array.prototype.slice.call(arguments)})}};