Comparing version 1.0.1 to 1.0.2
@@ -78,3 +78,3 @@ 'use strict'; | ||
// If it exceeds one frame, the remaining tasks will be put into the next frame. | ||
const loopSlice = (l, fn) => { | ||
const loopSlice = (l, fn, taskTime = 50) => { | ||
return new Promise((resolve) => { | ||
@@ -93,3 +93,3 @@ let i = -1; | ||
const t = now(); | ||
if (t - start > 13) { | ||
if (t - start > taskTime) { | ||
start = t; | ||
@@ -96,0 +96,0 @@ raf(run); |
@@ -74,3 +74,3 @@ const objectToString = Object.prototype.toString; | ||
// If it exceeds one frame, the remaining tasks will be put into the next frame. | ||
const loopSlice = (l, fn) => { | ||
const loopSlice = (l, fn, taskTime = 50) => { | ||
return new Promise((resolve) => { | ||
@@ -89,3 +89,3 @@ let i = -1; | ||
const t = now(); | ||
if (t - start > 13) { | ||
if (t - start > taskTime) { | ||
start = t; | ||
@@ -92,0 +92,0 @@ raf(run); |
@@ -85,3 +85,3 @@ (function (global, factory) { | ||
// If it exceeds one frame, the remaining tasks will be put into the next frame. | ||
const loopSlice = (l, fn) => { | ||
const loopSlice = (l, fn, taskTime = 50) => { | ||
return new Promise((resolve) => { | ||
@@ -100,3 +100,3 @@ let i = -1; | ||
const t = now(); | ||
if (t - start > 13) { | ||
if (t - start > taskTime) { | ||
start = t; | ||
@@ -103,0 +103,0 @@ raf(run); |
@@ -42,2 +42,3 @@ export type BaseType = | ||
fn: (i: number) => void | boolean, | ||
taskTime?: number, | ||
) => Promise<void>; |
{ | ||
"name": "aidly", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Tool library.", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
14036
416