question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: pass T in onDidDismiss to OverlayEventDetail

See original GitHub issue

Feature 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aivinog1commented, May 27, 2020

@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.

1reaction
liamdebeasicommented, May 27, 2020

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 😊.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found