@sohanemon/utils 3.0.5 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  import { EffectCallback } from 'react';
2
2
  export declare const useClickOutside: (callback?: () => void) => any;
3
3
  export declare function useMediaQuery(tailwindBreakpoint: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | `(${string})`): any;
4
- export declare const useSwiperRef: () => any[];
5
4
  export declare function useEffectOnce(effect: EffectCallback): void;
6
5
  export declare function useUpdateEffect(effect: EffectCallback, deps: any[]): void;
7
6
  export declare function useDebounce<T>(state: T, delay?: number): T;
@@ -55,29 +55,6 @@ export function useMediaQuery(tailwindBreakpoint) {
55
55
  }, [parsedQuery]);
56
56
  return matches;
57
57
  }
58
- export const useSwiperRef = () => {
59
- const [navigationElement, setNavigationElement] = useState(null);
60
- const ref = useRef(null);
61
- useEffect(() => {
62
- setNavigationElement(ref.current);
63
- }, []);
64
- return [navigationElement, ref];
65
- };
66
- // call the hook
67
- // const [nextEl, nextRef] = useSwiperRef();
68
- // const [prevEl, prevRef] = useSwiperRef();
69
- // add to navigation module
70
- // <Swiper
71
- // modules={[Navigation]}
72
- // navigation={{
73
- // prevEl,
74
- // nextEl,
75
- // }}
76
- // >
77
- // ...
78
- // </Swiper>;
79
- // add ref to any element which may trigger
80
- // <button ref={nextRef}>...</button>;
81
58
  export function useEffectOnce(effect) {
82
59
  // eslint-disable-next-line react-hooks/exhaustive-deps
83
60
  useEffect(effect, []);
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@sohanemon/utils",
3
- "version": "3.0.5",
3
+ "version": "4.0.0",
4
4
  "description": "",
5
5
  "source": "./src/index.ts",
6
+ "type": "module",
6
7
  "main": "./dist/index.js",
7
8
  "types": "./dist/index.d.ts",
8
9
  "exports": {