Skip to content

Commit 128933a

Browse files
authored
Merge pull request #2 from numandev1/refactor/popup
refactor: popup
2 parents 381b10d + 31db7fc commit 128933a

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

β€Žpackage.jsonβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build": "node utils/build.js",
1212
"start": "node utils/webserver.js",
1313
"prettier": "prettier --write '**/*.{js,jsx,ts,tsx,json,css,scss,md}'",
14-
"prepare:prod": "NODE_ENV=production npm run build"
14+
"zip": "NODE_ENV=production ./node_modules/.bin/webpack --config ./utils/build.js --mode production"
1515
},
1616
"dependencies": {
1717
"arrive": "^2.4.1",

β€Žsrc/pages/Content/hooks/useDebouncedCallback.tsβ€Ž

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {useRef, useEffect, useMemo} from 'react';
1+
// @ts-nocheck
2+
import { useRef, useEffect, useMemo } from 'react';
23

34
export interface CallOptions {
45
leading?: boolean;
@@ -87,12 +88,12 @@ export interface DebouncedState<T extends (...args: any[]) => ReturnType<T>>
8788
* const status = debounced.pending() ? "Pending..." : "Ready"
8889
*/
8990
export default function useDebouncedCallback<
90-
T extends (...args: any[]) => ReturnType<T>,
91+
T extends (...args: any[]) => ReturnType<T>
9192
>(func: T, wait?: number, options?: Options): DebouncedState<T> {
92-
const lastCallTime = useRef(null);
93+
const lastCallTime = useRef<any>(null);
9394
const lastInvokeTime = useRef(0);
94-
const timerId = useRef(null);
95-
const lastArgs = useRef<unknown[]>([]);
95+
const timerId = useRef<any>(null);
96+
const lastArgs = useRef<any>([]);
9697
const lastThis = useRef<unknown>();
9798
const result = useRef<ReturnType<T>>();
9899
const funcRef = useRef(func);
@@ -107,13 +108,13 @@ export default function useDebouncedCallback<
107108
throw new TypeError('Expected a function');
108109
}
109110

110-
wait = +wait || 0;
111+
wait = +(wait || 0);
111112
options = options || {};
112113

113114
const leading = !!options.leading;
114115
const trailing = 'trailing' in options ? !!options.trailing : true; // `true` by default
115116
const maxing = 'maxWait' in options;
116-
const maxWait = maxing ? Math.max(+options.maxWait || 0, wait) : null;
117+
const maxWait: any = maxing ? Math.max(+options.maxWait || 0, wait) : null;
117118

118119
useEffect(() => {
119120
mounted.current = true;

β€Žutils/build.jsβ€Ž

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ process.env.BABEL_ENV = 'production';
33
process.env.NODE_ENV = 'production';
44
process.env.ASSET_PATH = '/';
55

6-
var webpack = require('webpack'),
7-
path = require('path'),
6+
var path = require('path'),
87
fs = require('fs'),
98
config = require('../webpack.config'),
109
ZipPlugin = require('zip-webpack-plugin');
@@ -22,6 +21,4 @@ config.plugins = (config.plugins || []).concat(
2221
})
2322
);
2423

25-
webpack(config, function (err) {
26-
if (err) throw err;
27-
});
24+
module.exports = config;

0 commit comments

Comments
Β (0)