efront 4.0.31 → 4.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  async function wait(call, time = 80, step = +time >>> 4 | 1) {
2
2
  var res;
3
- while (!(res = await call()) && time > 0) await new Promise(ok => setTimeout(ok, step)), time -= step;
3
+ if (isFunction(call)) while (!(res = await call()) && time > 0) await new Promise(ok => setTimeout(ok, step)), time -= step;
4
+ else res = new Promise(ok => setTimeout(ok, call));
4
5
  return res;
5
6
  }
@@ -0,0 +1,3 @@
1
+ var time = new Date;
2
+ await wait(200);
3
+ console.log(new Date - time);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.0.31",
3
+ "version": "4.0.32",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {