use-scroll-bar
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -1,5 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var scrollbar_1 = require("./scrollbar"); | ||
exports.useScrollbar = scrollbar_1.scrollbar; | ||
!function(e,r){for(var t in r)e[t]=r[t]}(exports,function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=0)}([function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(1);r.useScrollbar=n.scrollbar},function(e,r,t){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e}).apply(this,arguments)};Object.defineProperty(r,"__esModule",{value:!0});var o=t(2);r.scrollbar=function(e){void 0===e&&(e=null);var r=o.useState({directionX:null,directionY:null,scrollY:0,scrollX:0}),t=r[0],i=r[1],l="undefined"==typeof window,u=null,c=l?0:window.scrollX,f=l?0:window.scrollY,s=function(){var e=window.scrollY,r=window.scrollX;r>c?i(n(n({},t),{directionX:"right",scrollX:r})):r<c&&i(n(n({},t),{directionX:"left",scrollX:r})),e>f?i(n(n({},t),{directionY:"down",scrollY:e})):e<f&&i(n(n({},t),{directionY:"up",scrollY:e})),c=r,f=e},a=function(){var r=150;null!==e&&"object"==typeof e&&(r=e.delay||r),clearTimeout(u),u=setTimeout(s,r)};return o.useEffect((function(){if(!l)return window.addEventListener("scroll",a),function(){window.removeEventListener("scroll",a)}}),[]),t}},function(e,r){e.exports=require("react")}])); | ||
//# sourceMappingURL=index.js.map |
@@ -7,6 +7,10 @@ interface IScrollbarState { | ||
} | ||
interface IConfig { | ||
delay: number; | ||
} | ||
declare type TParams = IConfig | null; | ||
/** | ||
* scrollbar hook | ||
*/ | ||
export declare function scrollbar(): IScrollbarState; | ||
export declare function scrollbar(config?: TParams): IScrollbarState; | ||
export {}; |
{ | ||
"name": "use-scroll-bar", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Get information of window scrollbar like current position and direction of last scroll.", | ||
@@ -16,3 +16,4 @@ "main": "lib/index.js", | ||
"commit": "git-cz", | ||
"build": "tsc" | ||
"build": "webpack --mode development", | ||
"build:prod": "webpack --mode production" | ||
}, | ||
@@ -23,6 +24,11 @@ "devDependencies": { | ||
"cz-conventional-changelog": "^3.0.2", | ||
"html-webpack-plugin": "^3.2.0", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"semantic-release": "^15.14.0", | ||
"typescript": "^3.7.4" | ||
"source-map-loader": "^0.2.4", | ||
"ts-loader": "^6.2.1", | ||
"typescript": "^3.7.4", | ||
"webpack": "^4.41.5", | ||
"webpack-cli": "^3.3.10" | ||
}, | ||
@@ -29,0 +35,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11831
12
6
25
3