xnimorz/use-debounce

Why not export default?

Closed this issue · 2 comments

There is no other export from the module, why not export default? So we can use:

import useDebounce from 'use-debounce';

in place of current

import { useDebounce } from 'use-debounce';

Hello @jacargentina !
I agree with you. The module won't increase the number of imports, so there are no reasons not to use default export.
I'm going to add this in nearest versions.

Hello, @jacargentina
According to the #7 issue, this library will get 2 different implementations for caching and for callbacks.
By this reason, you can use default import if you want to import definite module:

import useDebounce from 'use-debounce/cache';

or you can still use { useDebounce } export:

import { useDebounce } from 'use-debounce';