unnecessary package removed

demo
NB 4 years ago
parent 7ddb740cb8
commit e69dcf99fb
  1. 7
      package.json
  2. 4
      src/components/sideMenu/Wrapper.tsx
  3. 18
      src/lib/utils/commonUtil.ts
  4. 3
      src/modules/reactViewer/ReactViewer.tsx
  5. 10
      yarn.lock

@ -40,8 +40,7 @@
"postcompile": "cp -r ./src/types ./lib/types" "postcompile": "cp -r ./src/types ./lib/types"
}, },
"dependencies": { "dependencies": {
"epubjs": "^0.3.88", "epubjs": "^0.3.88"
"throttle-debounce": "^3.0.1"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.13.14", "@babel/cli": "^7.13.14",
@ -61,7 +60,6 @@
"@types/react-dom": "^17.0.0", "@types/react-dom": "^17.0.0",
"@types/react-redux": "^7.1.16", "@types/react-redux": "^7.1.16",
"@types/styled-components": "^5.1.7", "@types/styled-components": "^5.1.7",
"@types/throttle-debounce": "^2.1.0",
"babel-plugin-module-resolver": "4.0.0", "babel-plugin-module-resolver": "4.0.0",
"babel-plugin-styled-components": "^1.12.0", "babel-plugin-styled-components": "^1.12.0",
"gh-pages": "^3.1.0", "gh-pages": "^3.1.0",
@ -73,8 +71,7 @@
"typescript": "^4.2.3" "typescript": "^4.2.3"
}, },
"peerDependencies": { "peerDependencies": {
"react": ">=17.0.1", "react": ">=17.0.1"
"throttle-debounce": ">=3.0.1"
}, },
"eslintConfig": { "eslintConfig": {
"extends": [ "extends": [

@ -38,12 +38,12 @@ const Container = styled.div`
}; };
transition: .4s ${styles.transition}; transition: .4s ${styles.transition};
overflow-y: auto; overflow-y: auto;
${styles.scrollbar()}; ${styles.scrollbar(0)};
`; `;
const Header = styled.div` const Header = styled.div`
width: 100%; width: 100%;
height: 64px; min-height: 64px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;

@ -198,4 +198,22 @@ export const getSelectionPosition = (
height: selectionHeight, height: selectionHeight,
width: selectionWidth width: selectionWidth
}; };
}
/**
* Debounce
* @param func Target function
* @param timeout delay
*/
export function debounce<Params extends any[]>(
timeout: number,
func: (...args: Params) => any,
): (...args: Params) => void {
let timer: NodeJS.Timeout
return (...args: Params) => {
clearTimeout(timer)
timer = setTimeout(() => {
func(...args)
}, timeout)
}
} }

@ -1,12 +1,11 @@
import React, { useState, useEffect, useRef, useCallback, useMemo } from "react" import React, { useState, useEffect, useRef, useCallback, useMemo } from "react"
import { Book, Rendition, Contents } from "epubjs" import { Book, Rendition, Contents } from "epubjs"
import { debounce } from "throttle-debounce"
// modules // modules
import EpubViewer from "modules/epubViewer/EpubViewer" import EpubViewer from "modules/epubViewer/EpubViewer"
// components // components
import LoadingView from 'LoadingView' import LoadingView from 'LoadingView'
// utils // utils
import { timeFormatter } from 'lib/utils/commonUtil' import { debounce, timeFormatter } from 'lib/utils/commonUtil'
// styles // styles
import viewerDefaultStyles from 'modules/reactViewer/viewerStyle' import viewerDefaultStyles from 'modules/reactViewer/viewerStyle'
// types // types

@ -2128,11 +2128,6 @@
dependencies: dependencies:
"@types/jest" "*" "@types/jest" "*"
"@types/throttle-debounce@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz#1c3df624bfc4b62f992d3012b84c56d41eab3776"
integrity sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==
"@types/uglify-js@*": "@types/uglify-js@*":
version "3.13.0" version "3.13.0"
resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.13.0.tgz#1cad8df1fb0b143c5aba08de5712ea9d1ff71124" resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.13.0.tgz#1cad8df1fb0b143c5aba08de5712ea9d1ff71124"
@ -11071,11 +11066,6 @@ throat@^5.0.0:
resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b" resolved "https://registry.yarnpkg.com/throat/-/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b"
integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA== integrity sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==
throttle-debounce@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/throttle-debounce/-/throttle-debounce-3.0.1.tgz#32f94d84dfa894f786c9a1f290e7a645b6a19abb"
integrity sha512-dTEWWNu6JmeVXY0ZYoPuH5cRIwc0MeGbJwah9KUNYSJwommQpCzTySTpEe8Gs1J23aeWEuAobe4Ag7EHVt/LOg==
through2@^2.0.0: through2@^2.0.0:
version "2.0.5" version "2.0.5"
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd"

Loading…
Cancel
Save