Skip to content

Commit

Permalink
Add dist
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptex committed Apr 2, 2018
1 parent 5ff356e commit bafc6a8
Show file tree
Hide file tree
Showing 6 changed files with 1,787 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/env", "@babel/stage-2"]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ typings/
# dotenv environment variables file
.env

# Misc
.DS_Store
36 changes: 36 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.debounce = void 0;

var _this = void 0,
_arguments = arguments;

var debounce = function debounce(func, wait, immediate) {
var timeout;
wait = wait ? wait : 15;
return function () {
var context = _this;
var args = _arguments;

var later = function later() {
timeout = null;

if (!immediate) {
func.apply(context, args);
}
};

var callNow = immediate && timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);

if (callNow) {
func.apply(context, args);
}
};
};

exports.debounce = debounce;
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "@three11/debounce",
"version": "0.1.1",
"version": "0.2.0",
"description": "Debounce multiple function executions",
"main": "index.js",
"main": "dist/index.js",
"scripts": {
"build": "babel src -d dist"
},
"repository": {
"type": "git",
"url": "git+https://github.com/three11/debounce.git"
Expand Down Expand Up @@ -35,5 +38,11 @@
"bugs": {
"url": "https://github.com/three11/debounce/issues"
},
"homepage": "https://github.com/three11/debounce#readme"
"homepage": "https://github.com/three11/debounce#readme",
"devDependencies": {
"@babel/cli": "^7.0.0-beta.42",
"@babel/core": "^7.0.0-beta.42",
"@babel/preset-env": "^7.0.0-beta.42",
"@babel/preset-stage-2": "^7.0.0-beta.42"
}
}
File renamed without changes.
Loading

0 comments on commit bafc6a8

Please sign in to comment.