-
-
Notifications
You must be signed in to change notification settings - Fork 173
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
useModal().create accepts the returnBoolean option in its second argument. The typing of modal.show indicates it can return BvTriggerableEvent | boolean | null, so I would have expected it to return boolean in this case. However, it still returns BvTriggerableEvent when returnBoolean is set to true.
I'd personally like to see an API that doesn't require type guards, which brings two options to mind:
- Remove
returnBooleanand always returnBvTriggerableEvent - Make
returnBooleanimpact the return type (VueUse does crazy stuff like this)
As an aside, I also don't know of a situation where null should be returned, so it would be nice if the return type was only BvTriggerableEvent.
Reproduction
https://stackblitz.com/edit/github-y6vc86fd?file=src%2FApp.vue
Used Package Manager
pnpm
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working