0.0.19 • Published 4 years ago

use-on-expire v0.0.19

Weekly downloads
-
License
ISC
Repository
github
Last release
4 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

4 years ago

0.0.18

4 years ago

0.0.17

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

1.0.11

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago