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

Optimizing getting cloud storage #3776

Merged
merged 7 commits into from
Oct 14, 2021
Merged

Conversation

Marishka17
Copy link
Contributor

@Marishka17 Marishka17 commented Oct 7, 2021

Motivation and context

Resolve #3759
getting_storages

How has this been tested?

Manually

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

@Marishka17 Marishka17 requested a review from bsekachev as a code owner October 7, 2021 09:21
@Marishka17 Marishka17 changed the title Optimizing getting cloud storage [WIP] Optimizing getting cloud storage Oct 7, 2021
@Marishka17 Marishka17 force-pushed the mk/optimize_getting_cloud_storages branch from 9a55eb8 to 4235719 Compare October 8, 2021 08:50
@Marishka17 Marishka17 changed the title [WIP] Optimizing getting cloud storage Optimizing getting cloud storage Oct 8, 2021
@bsekachev bsekachev self-assigned this Oct 11, 2021
initialized: boolean;
id: number | null;
preview: string;
error: string | null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you really need to store error in global state for CloudStoragePreview and CloudStorageStatus?

Comment on lines 138 to 149
fetching: boolean;
initialized: boolean;
id: number | null;
status: string | null;
error: string | null;
}

export interface CloudStoragePreview {
fetching: boolean;
initialized: boolean;
id: number | null;
preview: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reduce code duplication using typescript Pick?

Comment on lines 138 to 142
fetching: boolean;
initialized: boolean;
id: number | null;
status: string | null;
error: string | null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you think if it be like this:

[index: number]: {
    fetching: boolean;
    initialized: boolean;
    id: number | null;
    status: string | null;
    error: string | null;
}

reducers and useSelectors callback would be easier?

preview: string;
error: string | null;
}
type CloudStorageStatus = Pick<CloudStorageAdditional, 'fetching' | 'initialized' | 'id' | 'error' | 'status'>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need id field here if it is a key now?

@Marishka17 Marishka17 changed the title Optimizing getting cloud storage [WIP] Optimizing getting cloud storage Oct 11, 2021
@Marishka17 Marishka17 changed the title [WIP] Optimizing getting cloud storage Optimizing getting cloud storage Oct 11, 2021
@bsekachev bsekachev merged commit 8c38652 into develop Oct 14, 2021
@bsekachev bsekachev deleted the mk/optimize_getting_cloud_storages branch October 21, 2021 11:12
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.

Optimize getting cloud storages
2 participants