Gathering detailed insights and metrics for moment-hooks
Gathering detailed insights and metrics for moment-hooks
Gathering detailed insights and metrics for moment-hooks
Gathering detailed insights and metrics for moment-hooks
react-moment-hooks
React hooks for dealing with the Moment.js library.
@momentiris/hooks
Hooksies for me and you
@firanorg/mollitia-molestias-accusamus
[![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url]
pickpocket.js
Simple wrapper around common data structure. Objects, of arrays. Validation Rule Errors (Multiple error message per field), Life Cycle Hooks (Multiple callbacks per life cycle moment), etc...
npm install moment-hooks
Typescript
Module System
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
8 Stars
119 Commits
1 Forks
1 Watchers
9 Branches
1 Contributors
Updated on Jun 15, 2024
Latest Version
2.1.0
Package Id
moment-hooks@2.1.0
Unpacked Size
37.23 kB
Size
9.40 kB
File Count
42
Published on
Feb 16, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A module to group all the best hooks togheter.
yarn install moment-hooks
calls a function when a click occurs on the outside of the ref element
1import { useOutsideClick } from 'moment-hooks'; 2 3const ref = React.useRef(); 4useOutsideClick(ref, () => console.log("On click outside"));
makes handling of state array easier
1import { useArray } from 'moment-hooks'; 2 3const [list, actions] = useArray(["element 1"]);
the hook returns an array with two elements
Disables the scroll on body. Widely used in modals.
###Parameters
1import { useLockBodyScroll } from 'moment-hooks'; 2 3useLockBodyScroll();
or if you have it in a modal
1import { useLockBodyScroll } from 'moment-hooks'; 2 3const Modal = ({ isOpen }) => { 4 useLockBodyScroll(isOpen); 5 6 return <div>Modal</div>; 7}
Reduce the amount of time is updated. Useful when dealing with fetch.
1import { useDebounce } from 'moment-hooks'; 2 3const [inputValue, setInputValue] = React.useState("A value"); 4const debouncedInputValue = useDebounce(inputValue, 100);
returns the size of the window
1import { useWindowSize } from 'moment-hooks'; 2 3const { width, height } = useWindowSize();
returns the size of the reference
1import { useSize } from 'moment-hooks'; 2 3const { width, height } = useSize();
Works the same as useState just that it stores it's state in the querystring of the url.
A way to serialize the url string to a value in the state
A way to stringify the state.
1const [reportSettings, setReportSettings] = useQueryStringState( 2 { 3 from: moment() 4 .subtract(1, 'months') 5 .toDate(), 6 to: moment().toDate(), 7 }, 8 { 9 fromString: { 10 from: from => moment(from).toDate(), 11 to: to => moment(to).toDate(), 12 }, 13 toString: { 14 from: from => moment(from).format(), 15 to: to => moment(to).format(), 16 }, 17 } 18 );
logs the reason why a component has been updated
1import { useWhyDidYouUpdate } from 'moment-hooks'; 2 3useWhyDidYouUpdate('Register', props);
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
Found 0/2 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
12 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More