0.0.19 • Published 2 years ago

use-on-expire v0.0.19

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

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

1.0.11

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago