ublo-lib 1.7.0 → 1.7.1
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.
|
@@ -4,7 +4,7 @@ declare type Props = {
|
|
|
4
4
|
thresholdPixels?: number;
|
|
5
5
|
off?: boolean;
|
|
6
6
|
};
|
|
7
|
-
declare const useScrollDirection: ({ initialDirection, thresholdPixels, off, }
|
|
7
|
+
declare const useScrollDirection: ({ initialDirection, thresholdPixels, off, }?: Props) => {
|
|
8
8
|
scrollDir: "up" | "down" | undefined;
|
|
9
9
|
};
|
|
10
10
|
export default useScrollDirection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-scroll-direction.d.ts","sourceRoot":"","sources":["../../../src/common/hooks/use-scroll-direction.ts"],"names":[],"mappings":"AAEA,aAAK,SAAS,GAAG,IAAI,GAAG,MAAM,CAAC;AAE/B,aAAK,KAAK,GAAG;IACX,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAKF,QAAA,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"use-scroll-direction.d.ts","sourceRoot":"","sources":["../../../src/common/hooks/use-scroll-direction.ts"],"names":[],"mappings":"AAEA,aAAK,SAAS,GAAG,IAAI,GAAG,MAAM,CAAC;AAE/B,aAAK,KAAK,GAAG;IACX,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAKF,QAAA,MAAM,kBAAkB,iDAIrB,KAAK;;CAoCP,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useEffect } from "react";
|
|
2
2
|
const SCROLL_UP = "up";
|
|
3
3
|
const SCROLL_DOWN = "down";
|
|
4
|
-
const useScrollDirection = ({ initialDirection, thresholdPixels, off, }) => {
|
|
4
|
+
const useScrollDirection = ({ initialDirection, thresholdPixels, off, } = {}) => {
|
|
5
5
|
const [scrollDir, setScrollDir] = useState(initialDirection);
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
const threshold = thresholdPixels || 0;
|