Skip to content

Commit

Permalink
Merge branch 'fix/debounce' into tmp/20241101
Browse files Browse the repository at this point in the history
  • Loading branch information
vvvvvv1vvvvvv committed Oct 31, 2024
2 parents 712df9c + 8910de1 commit 37c4c81
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
"clsx": "1.1.1",
"crypto-browserify": "3.12.0",
"dayjs": "1.10.7",
"debounce": "1.2.1",
"eth-block-tracker": "5.0.1",
"eth-json-rpc-filters": "6.0.0",
"eth-rpc-errors": "4.0.3",
Expand Down Expand Up @@ -185,10 +184,10 @@
"eslint-webpack-plugin": "2.5.4",
"file-loader": "6.2.0",
"fs-extra": "10.0.0",
"fs-readdir-recursive": "1.1.0",
"gulp": "4.0.2",
"gulp-sort": "2.0.0",
"gulp-zip": "5.1.0",
"fs-readdir-recursive": "1.1.0",
"html-webpack-plugin": "5.3.1",
"i18next": "23.4.1",
"jest": "29.7.0",
Expand Down
8 changes: 4 additions & 4 deletions src/background/utils/persistStore.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* eslint-disable @typescript-eslint/ban-types */
import { storage } from 'background/webapi';
import { debounce } from 'debounce';
import { debounce } from 'lodash';
import { syncStateToUI } from './broadcastToUI';
import { BROADCAST_TO_UI_EVENTS } from '@/utils/broadcastToUI';

const persistStorage = (name: string, obj: object) => {
debounce(storage.set(name, obj), 1000);
};
const persistStorage = debounce((name: string, obj: object) => {
storage.set(name, obj);
}, 500);

interface CreatePersistStoreParams<T> {
name: string;
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9797,11 +9797,6 @@ [email protected], dayjs@^1.9.1:
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468"
integrity sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==

[email protected]:
version "1.2.1"
resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.1.tgz#38881d8f4166a5c5848020c11827b834bcb3e0a5"
integrity sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==

[email protected], debug@^2.2.0, debug@^2.3.3, debug@^2.6.9:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
Expand Down

0 comments on commit 37c4c81

Please sign in to comment.