eBay / nice-modal-react

A modal state manager for React.
https://ebay.github.io/nice-modal-react
MIT License
2.04k stars 118 forks source link

feat: support return types #52

Closed chooin closed 2 years ago

chooin commented 2 years ago

Before:

type Result = string;

NiceModal.show(Modal, props) as Promise<Result>

After:

type Result = string;

NiceModal.show<Result>(Modal, props)
codecov-commenter commented 2 years ago

Codecov Report

Merging #52 (9780d65) into main (e6d8431) will not change coverage. The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main       #52   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          184       184           
  Branches        29        29           
=========================================
  Hits           184       184           
Impacted Files Coverage Δ
src/index.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e6d8431...9780d65. Read the comment docs.

supnate commented 2 years ago

Thanks @chooin for this nice enhancement!