vigzmv / react-promise-suspense

A React hook for resolving promises with Suspense support. <1kb bundle.
https://npmjs.com/package/react-promise-suspense
MIT License
162 stars 9 forks source link

Can inputs be made optional? #23

Closed tharrison4815 closed 2 years ago

tharrison4815 commented 3 years ago

Personally I find it more natural to use usePromise by passing an arrow function instead of a reference to a function.

I amended the codebox example to show what I mean: https://codesandbox.io/s/react-promise-suspense-example-forked-dkjp6

usePromise(waitt, [5000]) vs usePromise(() => wait(5000), [])

The problem is I am required to enter an empty inputs array which seems pretty redundant. Also, based on other hooks it might appear to users that it is a dependency array.

Is it possible to make this optional?

Boris-Vladimirovich commented 3 years ago

Hey! I've added the #possibility not to pass inputs in my PR #24