This repository was archived by the owner on Sep 5, 2023. It is now read-only.
FRONTEND-8643 :: Feature :: Create NetworkDataSource repository providers#144
Open
FRONTEND-8643 :: Feature :: Create NetworkDataSource repository providers#144
Conversation
Alex-DA
approved these changes
Mar 23, 2023
doup
approved these changes
Mar 23, 2023
Contributor
doup
left a comment
There was a problem hiding this comment.
Approving, but check the comment, I don't think the generics are correct.
| import { DataSourceMapper, GetDataSourceMapper, PutDataSourceMapper } from "./data-source-mapper"; | ||
| import { ArrayMapper, BlankMapper, JsonDeserializerMapper } from "../mapper/mapper"; | ||
|
|
||
| export function provideGetArrayNetworkDataSource<T extends unknown | void>( |
Contributor
There was a problem hiding this comment.
What do you mean by T extends unknown | void? Isn't this the same as just T? Also, regarding the void, does GetDataSource<void[]> make sense? We can probably leave it as:
Suggested change
| export function provideGetArrayNetworkDataSource<T extends unknown | void>( | |
| export function provideGetArrayNetworkDataSource<T>( |
Contributor
Author
There was a problem hiding this comment.
@doup The thing is that the generic type should allow void as a type, and having T you cannot create a GetDataSource<void>.
Since this is a generic library, I didn't want to restrict the usage because the API might not be ours and might return nothing at some endpoint with a call of type GET. What do you think?
lucianosantana
approved these changes
Apr 7, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Asana task link:
https://app.asana.com/0/1109863238977521/1204241389098643
Merge / Pull request information: