Commit 409c94b4 authored by baesangjune's avatar baesangjune
Browse files

rm node_modules

parent df52aea8
import { EffectCallback, DependencyList } from 'react';
/**
* Runs an effect only when the dependencies have changed, skipping the
* initial "on mount" run. Caution, if the dependency list never changes,
* the effect is **never run**
*
* ```ts
* const ref = useRef<HTMLInput>(null);
*
* // focuses an element only if the focus changes, and not on mount
* useUpdateEffect(() => {
* const element = ref.current?.children[focusedIdx] as HTMLElement
*
* element?.focus()
*
* }, [focusedIndex])
* ```
* @param effect An effect to run on mount
*
* @category effects
*/
declare function useUpdateEffect(fn: EffectCallback, deps: DependencyList): void;
export default useUpdateEffect;
import { useEffect, useRef } from 'react';
/**
* Runs an effect only when the dependencies have changed, skipping the
* initial "on mount" run. Caution, if the dependency list never changes,
* the effect is **never run**
*
* ```ts
* const ref = useRef<HTMLInput>(null);
*
* // focuses an element only if the focus changes, and not on mount
* useUpdateEffect(() => {
* const element = ref.current?.children[focusedIdx] as HTMLElement
*
* element?.focus()
*
* }, [focusedIndex])
* ```
* @param effect An effect to run on mount
*
* @category effects
*/
function useUpdateEffect(fn, deps) {
var isFirst = useRef(true);
useEffect(function () {
if (isFirst.current) {
isFirst.current = false;
return;
}
return fn();
}, deps);
}
export default useUpdateEffect;
\ No newline at end of file
/// <reference types="react" />
/**
* Returns a ref that is immediately updated with the new value
*
* @param value The Ref value
* @category refs
*/
export default function useUpdatedRef<T>(value: T): import("react").MutableRefObject<T>;
import { useRef } from 'react';
/**
* Returns a ref that is immediately updated with the new value
*
* @param value The Ref value
* @category refs
*/
export default function useUpdatedRef(value) {
var valueRef = useRef(value);
valueRef.current = value;
return valueRef;
}
\ No newline at end of file
/**
* Attach a callback that fires when a component unmounts
*
* @param fn Handler to run when the component unmounts
* @category effects
*/
export default function useWillUnmount(fn: () => void): void;
import useUpdatedRef from './useUpdatedRef';
import { useEffect } from 'react';
/**
* Attach a callback that fires when a component unmounts
*
* @param fn Handler to run when the component unmounts
* @category effects
*/
export default function useWillUnmount(fn) {
var onUnmount = useUpdatedRef(fn);
useEffect(function () {
return function () {
return onUnmount.current();
};
}, []);
}
\ No newline at end of file
{
"_args": [
[
"@restart/hooks@0.3.25",
"C:\\Users\\Korea\\Desktop\\2020winter\\search-page"
]
],
"_from": "@restart/hooks@0.3.25",
"_id": "@restart/hooks@0.3.25",
"_inBundle": false,
"_integrity": "sha512-m2v3N5pxTsIiSH74/sb1yW8D9RxkJidGW+5Mfwn/lHb2QzhZNlaU1su7abSyT9EGf0xS/0waLjrf7/XxQHUk7w==",
"_location": "/@restart/hooks",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@restart/hooks@0.3.25",
"name": "@restart/hooks",
"escapedName": "@restart%2fhooks",
"scope": "@restart",
"rawSpec": "0.3.25",
"saveSpec": null,
"fetchSpec": "0.3.25"
},
"_requiredBy": [
"/react-bootstrap",
"/react-overlays"
],
"_resolved": "https://registry.npmjs.org/@restart/hooks/-/hooks-0.3.25.tgz",
"_spec": "0.3.25",
"_where": "C:\\Users\\Korea\\Desktop\\2020winter\\search-page",
"author": {
"name": "Jason Quense",
"email": "monastic.panic@gmail.com"
},
"bugs": {
"url": "https://github.com/react-restart/hooks/issues"
},
"dependencies": {
"lodash": "^4.17.15",
"lodash-es": "^4.17.15"
},
"homepage": "https://github.com/react-restart/hooks#readme",
"jest": {
"preset": "@4c",
"rootDir": "./test",
"setupFilesAfterEnv": [
"./setup.js"
]
},
"license": "MIT",
"main": "cjs/index.js",
"module": "esm/index.js",
"name": "@restart/hooks",
"peerDependencies": {
"react": "^16.8.0"
},
"prettier": {
"singleQuote": true,
"semi": false,
"trailingComma": "all"
},
"publishConfig": {
"access": "public",
"directory": "lib"
},
"release": {
"conventionalCommits": true
},
"repository": {
"type": "git",
"url": "git+https://github.com/jquense/react-common-hooks.git"
},
"types": "cjs/index.d.ts",
"version": "0.3.25"
}
{
"name": "@restart/hooks/useAnimationFrame",
"private": true,
"main": "../cjs/useAnimationFrame.js",
"module": "../esm/useAnimationFrame.js",
"types": "../esm/useAnimationFrame.d.ts"
}
{
"name": "@restart/hooks/useBreakpoint",
"private": true,
"main": "../cjs/useBreakpoint.js",
"module": "../esm/useBreakpoint.js",
"types": "../esm/useBreakpoint.d.ts"
}
{
"name": "@restart/hooks/useCallbackRef",
"private": true,
"main": "../cjs/useCallbackRef.js",
"module": "../esm/useCallbackRef.js",
"types": "../esm/useCallbackRef.d.ts"
}
{
"name": "@restart/hooks/useCommittedRef",
"private": true,
"main": "../cjs/useCommittedRef.js",
"module": "../esm/useCommittedRef.js",
"types": "../esm/useCommittedRef.d.ts"
}
{
"name": "@restart/hooks/useCustomEffect",
"private": true,
"main": "../cjs/useCustomEffect.js",
"module": "../esm/useCustomEffect.js",
"types": "../esm/useCustomEffect.d.ts"
}
{
"name": "@restart/hooks/useEventCallback",
"private": true,
"main": "../cjs/useEventCallback.js",
"module": "../esm/useEventCallback.js",
"types": "../esm/useEventCallback.d.ts"
}
{
"name": "@restart/hooks/useEventListener",
"private": true,
"main": "../cjs/useEventListener.js",
"module": "../esm/useEventListener.js",
"types": "../esm/useEventListener.d.ts"
}
{
"name": "@restart/hooks/useFocusManager",
"private": true,
"main": "../cjs/useFocusManager.js",
"module": "../esm/useFocusManager.js",
"types": "../esm/useFocusManager.d.ts"
}
{
"name": "@restart/hooks/useForceUpdate",
"private": true,
"main": "../cjs/useForceUpdate.js",
"module": "../esm/useForceUpdate.js",
"types": "../esm/useForceUpdate.d.ts"
}
{
"name": "@restart/hooks/useGlobalListener",
"private": true,
"main": "../cjs/useGlobalListener.js",
"module": "../esm/useGlobalListener.js",
"types": "../esm/useGlobalListener.d.ts"
}
{
"name": "@restart/hooks/useImage",
"private": true,
"main": "../cjs/useImage.js",
"module": "../esm/useImage.js",
"types": "../esm/useImage.d.ts"
}
{
"name": "@restart/hooks/useImmediateUpdateEffect",
"private": true,
"main": "../cjs/useImmediateUpdateEffect.js",
"module": "../esm/useImmediateUpdateEffect.js",
"types": "../esm/useImmediateUpdateEffect.d.ts"
}
{
"name": "@restart/hooks/useIntersectionObserver",
"private": true,
"main": "../cjs/useIntersectionObserver.js",
"module": "../esm/useIntersectionObserver.js",
"types": "../esm/useIntersectionObserver.d.ts"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment