Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

function-tree

Package Overview
Dependencies
Maintainers
3
Versions
487
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

function-tree - npm Package Compare versions

Comparing version 0.5.0-0-alpha.2f993c5f to 0.5.0-0-alpha.31e15eed

.nyc_output/0487e10e265abfd923a2882b6522f24b.json

26

lib/factories/debounce.js

@@ -6,5 +6,3 @@ 'use strict';

});
function createDebounce(time) {
var execution = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { timer: null, resolve: null };
function createDebounce(time, execution) {
function debounce(_ref) {

@@ -15,3 +13,3 @@ var path = _ref.path;

if (execution.timer) {
execution.resolve(path.discarded());
execution.resolve(path.discard());
clearTimeout(execution.timer);

@@ -21,3 +19,3 @@ }

execution.timer = setTimeout(function () {
execution.resolve(path.accepted());
execution.resolve(path.continue());
execution.timer = null;

@@ -34,17 +32,15 @@ execution.resolve = null;

function debounceFactory(time, continueBranch) {
return [createDebounce(time), {
accepted: continueBranch,
discarded: []
}];
function debounceFactory(time) {
// New execution on every call
var execution = { timer: null, resolve: null };
return createDebounce(time, execution);
}
debounceFactory.shared = function () {
// Shared execution
var execution = { timer: null, resolve: null };
return function debounceSharedFactory(time, continueBranch) {
return [createDebounce(time, execution), {
accepted: continueBranch,
discarded: []
}];
return function debounceSharedFactory(time) {
return createDebounce(time, execution);
};

@@ -51,0 +47,0 @@ };

{
"name": "function-tree",
"version": "0.5.0-0-alpha.2f993c5f",
"version": "0.5.0-0-alpha.31e15eed",
"description": "When a function is not enough",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc