From 84eec7d69ff92b5e00845ee37adf44b341f7aea4 Mon Sep 17 00:00:00 2001 From: wangcch Date: Sun, 11 Apr 2021 00:27:09 +0800 Subject: [PATCH] refactor(type): consistent-type-imports --- src/useDeepEffect.ts | 3 ++- src/useLoadImg.tsx | 9 ++------- src/useThrottle.ts | 4 ++-- src/useThrottleFn.ts | 4 ++-- src/useUpdateEffect.ts | 3 ++- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/useDeepEffect.ts b/src/useDeepEffect.ts index 6b89ecb..b980b31 100644 --- a/src/useDeepEffect.ts +++ b/src/useDeepEffect.ts @@ -1,4 +1,5 @@ -import { useEffect, EffectCallback, DependencyList } from "react"; +import type { EffectCallback, DependencyList } from "react"; +import { useEffect } from "react"; import useDeepCompareCache from "./useDeepCompareCache"; /** diff --git a/src/useLoadImg.tsx b/src/useLoadImg.tsx index 2d17329..56caf72 100644 --- a/src/useLoadImg.tsx +++ b/src/useLoadImg.tsx @@ -1,10 +1,5 @@ -import React, { - CSSProperties, - useState, - useEffect, - useMemo, - useCallback, -} from "react"; +import type { CSSProperties } from "react"; +import React, { useState, useEffect, useMemo, useCallback } from "react"; import useDeepCompareCache from "./useDeepCompareCache"; export type EImgState = "loading" | "done" | "error" | "idle"; diff --git a/src/useThrottle.ts b/src/useThrottle.ts index 7fdf4c9..5e433f1 100644 --- a/src/useThrottle.ts +++ b/src/useThrottle.ts @@ -1,8 +1,8 @@ -import { - useThrottle, +import type { ThrottleOptions, ControlFunctions, } from "@react-cmpt/use-throttle"; +import { useThrottle } from "@react-cmpt/use-throttle"; export type { ThrottleOptions, ControlFunctions }; diff --git a/src/useThrottleFn.ts b/src/useThrottleFn.ts index b9c8fb8..c7ac6ef 100644 --- a/src/useThrottleFn.ts +++ b/src/useThrottleFn.ts @@ -1,8 +1,8 @@ -import { - useThrottleFn, +import type { ThrottleFnOptions, ThrottleReturnResult, } from "@react-cmpt/use-throttle"; +import { useThrottleFn } from "@react-cmpt/use-throttle"; export type { ThrottleFnOptions, ThrottleReturnResult }; diff --git a/src/useUpdateEffect.ts b/src/useUpdateEffect.ts index 9646329..481c148 100644 --- a/src/useUpdateEffect.ts +++ b/src/useUpdateEffect.ts @@ -1,4 +1,5 @@ -import { useEffect, EffectCallback, DependencyList, useRef } from "react"; +import type { EffectCallback, DependencyList } from "react"; +import { useEffect, useRef } from "react"; /** * useUpdateEffect