0.0.19 • Published 3 years ago

use-on-expire v0.0.19

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

use-on-expiration

React hook that provide easy way to fire your function when date is expired. Showcase: https://mattibanko.github.io/demo-use-on-expire/

Usage:

  • date: single Date or array of dates (if array )
const { timeoutId, dateToRefresh } = useOnExpire({
  date, // single Date or array of dates (if array customFilter function will be use to choosing date to calculate threshold)
  fn: useCallback(() => setState(true), []), // function that will be fired when threshold will be reached
  delay?: 1000 // delay after function will be fired (in milliseconds)
  customFilter: (dates: Date[]) => Date // custom function for choosing date to calculate threshold (default: min())
});
0.0.19

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

1.0.11

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago