Skip to content

Commit

Permalink
Tweak debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Mar 29, 2024
1 parent 3f1fa68 commit 311497d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/pages/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const packagesList = {
view: 'content-filter',
content: {
view: 'update-on-timings-change',
debounce: true,
content: {
view: 'table',
data: 'entries.[totalTime and entry.name ~= #.filter].sort(selfTime desc, totalTime desc)',
Expand Down Expand Up @@ -253,6 +254,7 @@ const modulesList = {
view: 'content-filter',
content: {
view: 'update-on-timings-change',
debounce: true,
content: {
view: 'table',
data: `entries
Expand Down Expand Up @@ -284,6 +286,7 @@ const functionList = {
view: 'content-filter',
content: {
view: 'update-on-timings-change',
debounce: true,
content: {
view: 'table',
data: 'entries.[totalTime and entry.name ~= #.filter].sort(selfTime desc, totalTime desc)',
Expand Down
4 changes: 2 additions & 2 deletions app/views/update-on-timings-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ discovery.view.define('update-on-timings-change', function(el, config, data, con
const { timings = data, debounce, content } = config;
let scheduledRender = null;
const updateRender = () => {
if (scheduledRender) {
if (scheduledRender !== null) {
return;
}

Expand All @@ -18,7 +18,7 @@ discovery.view.define('update-on-timings-change', function(el, config, data, con

const unsubscribeSource = timings.on(
debounce
? utils.debounce(updateRender, debounce !== true ? debounce : { wait: 16, maxWait: 32 })
? utils.debounce(updateRender, debounce !== true ? debounce : { wait: 16, maxWait: 48 })
: updateRender
);

Expand Down

0 comments on commit 311497d

Please sign in to comment.