Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
huangriya committed Sep 8, 2023
1 parent 3ef2e0c commit 2101b36
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lib-agile",
"version": "1.0.0-beta.11",
"version": "1.0.0-beta.12",
"description": "简单方便快捷的综合库,包含工具函数、组件、样式,与第三方组件库形式优势互补。",
"type": "module",
"main": "./dist/lib-agile.umd.js",
Expand Down
20 changes: 19 additions & 1 deletion vitepress/function/browser.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 浏览器相关
# 浏览器性能相关

## 同步任务转异步任务,交给浏览器去调度

Expand All @@ -23,3 +23,21 @@ scheduling.done(() => {
// 如果没执行完成就要离开了,可以清除任务
scheduling.clear()
```

## 执行耗时任务

执行耗时任务,最大限度的不阻塞浏览器渲染

```javascript
import { runTask } from 'lib-agile'

for (let i = 0; i <= 10000; i++) {
runTask(() => {
console.log(i)
}).then(() => {
if (i === 100000) {
console.log('done')
}
})
}
```
10 changes: 10 additions & 0 deletions vitepress/function/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,13 @@ diffCount(1000, 900) // => 100

diffCount(900, 1000) // => 100
```

## 判断一个数是不是奇数

```javascript
import { isOdd } from 'lib-agile'

isOdd(1) // => true

isOdd(2) // => false
```

0 comments on commit 2101b36

Please sign in to comment.