feat: pass T in onDidDismiss to OverlayEventDetail
See original GitHub issueFeature Request
the onDidDismiss, e.g. for a Modal, returns OverlayEventDetail<any>.
The any is poor for coding, it would be better to be able to pass T.
Right now onDidDismiss is defined like so:
"onDidDismiss": () => Promise<OverlayEventDetail<any>>;
please change to
"onDidDismiss": <T = any>() => Promise<OverlayEventDetail<T>>;
so T is still optional, but if you want, you can have it typed now.
Ionic version:
[x] 4.x
Describe the Feature Request
Describe Preferred Solution
Describe Alternatives
Related Code
Additional Context
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Ionic v4 onDidDismis result which type?
You can pass a type to the onDidDismiss() method. Because OverlayEventDetail.data type is generic. modal.onDidDismiss<MyType>().then((event) => ...
Read more >Property 'onDidDismiss' does not exist on type ionic 4 and ...
When asking a question on SO please take some time to review the answers to see if any of them may solve your...
Read more >ionic/docs/core.json - UNPKG
"text": "role The role of the element that is dismissing the action sheet.\nThis can be useful in a button handler for determining which...
Read more >A Detailed Guide on ion-model in Ionic Framework
The dismiss() method on the modal controller can be used to dismiss the modal once it has been created. After the modal has...
Read more >How to declare and use modals in Ionic v4 | by David Dal Busco
A modal is a component and its annotation doesn't really change in comparison ... Another question which often pops up is “how to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nickwinger Yes, I’ll try to find such methods, but if there are too many such methods I think that the best solution is to split such PR to many.
In the first iteration, I can find all the possible places and describe them in the comments of this task.
Yes, thank you!
Here is our contributing guide that gives you an overview of how to make the changes, test, and create a PR: https://github.com/ionic-team/ionic/blob/master/.github/CONTRIBUTING.md#creating-a-pull-request.
Let me know if you have any questions 😊.