Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorkem CINAR committed Dec 13, 2017
1 parent 259d586 commit 3132f93
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
*.log*
dist
dist
typings
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
tsconfig.json
src
src
gulpfile.js
tslint.json
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "worker-interval",
"version": "1.0.0",
"version": "1.0.6",
"description": "setInterval and clearInterval implementation to support keep running on inactive tabs for Chrome, Firefox and IE",
"main": "dist/module.js",
"types": "dist/module.d.ts",
"types": "typings/module.d.ts",
"keywords": [
"clearInterval",
"clear interval",
Expand Down
6 changes: 4 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import WorkerInterval from "./workerInterval";

const workerInterval = new WorkerInterval();
export const clearInterval = workerInterval.clearInterval;
export const setInterval = workerInterval.setInterval;
export const clearInterval = (id:string): void => workerInterval.clearInterval(id);
export const setInterval = (callback: () => void, delay: number): string | null => {
return workerInterval.setInterval(callback, delay)
};
2 changes: 1 addition & 1 deletion src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ onmessage = (event) => {
switch (intervalWork.name) {
case "setInterval": {
intervalWork.name = "runCallback";
const intervalId = setInterval(() => { postMessage(intervalWork,); }, intervalWork.delay);
const intervalId = setInterval(() => { postMessage(intervalWork); }, intervalWork.delay);
scheduledIntervalWorks.push({
id: intervalWork.id,
intervalId,
Expand Down
7 changes: 4 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"declaration": true,
"declarationDir": "typings",
"noImplicitAny": true,
"noImplicitReturns": true,
"removeComments": true,
Expand All @@ -13,11 +14,11 @@
"target": "es5",
"outDir": "./dist",
"lib": [
"es6",
"webworker"
"es6",
"webworker"
]
},
"include": [
"src/**/*"
"src/**/*"
]
}

0 comments on commit 3132f93

Please sign in to comment.