opensearch-project / oui

OpenSearch UI Framework
Apache License 2.0
31 stars 65 forks source link

Rewrite `InitialIcon` computation without mutable variables #1186

Open ShatilKhan opened 6 months ago

ShatilKhan commented 6 months ago

Description

I have tried to use a helper function getIconAndLoadingStatus to return necessary values without having to mutate any variables.The returned values are then destructured into initialIcon and isLoading, which are used to set the state.

Issues Resolved

Fixes #1167

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

ShatilKhan commented 6 months ago

@BSFishy Can you let me know if this is the right approach?