Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Result a generic #188

Merged
merged 3 commits into from
Jul 11, 2022
Merged

Make Result a generic #188

merged 3 commits into from
Jul 11, 2022

Conversation

nmanu1
Copy link
Contributor

@nmanu1 nmanu1 commented Jul 11, 2022

Update Result to accept a generic type param that is passed to rawData.

J=SLAP-2231
TEST=auto, manual

Check that tests still pass and that the type param is optional. The default value is used unless a type is specified.

@nmanu1 nmanu1 requested a review from a team as a code owner July 11, 2022 14:29
@coveralls
Copy link

coveralls commented Jul 11, 2022

Pull Request Test Coverage Report for Build 2650497423

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 89.826%

Totals Coverage Status
Change from base Build 2650409210: 0.0%
Covered Lines: 210
Relevant Lines: 227

💛 - Coveralls

@oshi97
Copy link
Contributor

oshi97 commented Jul 11, 2022

Do the parent response objects and/or search services also need to take in a generic?

@nmanu1
Copy link
Contributor Author

nmanu1 commented Jul 11, 2022

Do the parent response objects and/or search services also need to take in a generic?

No, I made the the generic param optional by including a default, so the parent response objects aren't required to specify a type. Based on the item description, I assume we only want Result to accept a generic so that it can be used in the component library's CardProps to give compile-time checking when users write custom cards

@nmanu1 nmanu1 merged commit e87da49 into develop Jul 11, 2022
@nmanu1 nmanu1 deleted the dev/generic-result branch July 11, 2022 17:56
@alextaing alextaing mentioned this pull request Jul 26, 2022
alextaing added a commit that referenced this pull request Jul 27, 2022
## Version 1.9.0
### Changes
- `Result` now accepts a generic type parameter: a TS model representing one or more entity types generated by the new `yext types generate search` CLI command (#188)
- `matchedSubstrings` is now returned as a part of `spellCheck` in search responses (#192)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants