Skip to content

Commit

Permalink
update: change debounce to throttle
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Nov 7, 2024
1 parent 7fa1b48 commit 9be313e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 4.0.9

- 更新:部分功能细节

## 4.0.8

- 修复:播放页 调节播放器宽度 Firefox页面抖动bug
Expand Down
6 changes: 3 additions & 3 deletions src/components/items/NumberComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</template>
<script setup lang="ts">
import { watchDebounced } from '@vueuse/core'
import { watchThrottled } from '@vueuse/core'
import { ref } from 'vue'
import { INumberItem } from '../../types/item'
import { error } from '../../utils/logger'
Expand All @@ -25,7 +25,7 @@ const item = defineProps<INumberItem>()
const currValue = ref(BiliCleanerStorage.get(item.id, item.defaultValue))
watchDebounced(
watchThrottled(
currValue,
(newValue, oldValue) => {
try {
Expand Down Expand Up @@ -59,6 +59,6 @@ watchDebounced(
error(`NumberComp ${item.id} error`, err)
}
},
{ debounce: 100 },
{ throttle: 50 },
)
</script>
6 changes: 3 additions & 3 deletions src/components/items/StringComp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</template>
<script setup lang="ts">
import { watchDebounced } from '@vueuse/core'
import { watchThrottled } from '@vueuse/core'
import { ref } from 'vue'
import { IStringItem } from '../../types/item'
import { error } from '../../utils/logger'
Expand All @@ -23,7 +23,7 @@ const item = defineProps<IStringItem>()
const currValue = ref(BiliCleanerStorage.get(item.id, item.defaultValue))
watchDebounced(
watchThrottled(
currValue,
(newValue, oldValue) => {
try {
Expand All @@ -50,6 +50,6 @@ watchDebounced(
error(`StringComp ${item.id} error`, err)
}
},
{ debounce: 100 },
{ throttle: 50 },
)
</script>
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
userscript: {
name: 'bilibili 页面净化大师',
namespace: 'http://tampermonkey.net/',
version: '4.0.8',
version: '4.0.9',
description:
'净化 B站/哔哩哔哩 页面,支持「精简功能、播放器净化、过滤视频、过滤评论、全站黑白名单」,提供 300+ 功能,定制自己的 B 站',
author: 'festoney8',
Expand Down

0 comments on commit 9be313e

Please sign in to comment.