pieces-app / example-typescript

A React example project showing how to get started with Pieces TS SDK.
MIT License
35 stars 45 forks source link

feat: Abstract LocalStorage Usage in `Indicator.tsx` #125

Open Arindam200 opened 2 months ago

Arindam200 commented 2 months ago

Description

Currently, the Indicator.tsx component directly accesses localStorage to retrieve and manage the OS version. This approach can lead to code that is harder to test and maintain. To improve the codebase, we should abstract the localStorage interactions into a custom hook.

Proposed Solution

Create a custom hook, useOsVersion, to encapsulate the logic for accessing and updating the OS version from localStorage. This hook will manage the state and side effects related to localStorage, making the Indicator.tsx component cleaner and more focused on its primary responsibilities.

Benefits

Additional Notes

By abstracting the localStorage usage into a custom hook, we can enhance the maintainability and scalability of our codebase. This approach also promotes the separation of concerns, making each component and hook responsible for a single aspect of the application's functionality.

Agnish1611 commented 2 months ago

@Arindam200 I am interested in working on this issue. Please assign it to me.

brajeshgiri commented 1 month ago

@Arindam200 I am interested to work on this issue. Please assign it to me.