useFilePicker
useFilePicker copied to clipboard
feat: make openFilePicker function return a promise, add detection of picker cancellation
Summary:
- Adds long awaited return values to the opneFilePicker function, mentioned in #56
- Adds reliable detection of picker cancellation, mentioned in #88
Adds a new prop called "detectCancellation" that can be set to "promiseResultOnly", "promiseResultAndHookState" or false. Allows to define if the cancellation detection should be shown and when (only in the result type or also in hook state). Default is false because in most use cases we don't care about the cancelled selections.