You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve the HolySheets! library by introducing a withMetadata higher-order function to centralize metadata handling across all core operations (e.g., findFirst, findMany, updateFirst). This refactoring aims to enhance maintainability, readability, and consistency while adhering to SOLID principles.
Background
Currently, each core operation manages its own metadata logic, leading to code duplication and reduced clarity. Centralizing this functionality will streamline the codebase and ensure uniform metadata management.
Proposed Changes
Create withMetadata HOF:
Location:src/utils/operations/withMetadata.ts
Functionality: Handles metadata tasks such as timing, status determination, error handling, and metadata creation.
Parameters:
operationType: Type of operation (e.g., find, update).
Improve the HolySheets! library by introducing a
withMetadata
higher-order function to centralize metadata handling across all core operations (e.g.,findFirst
,findMany
,updateFirst
). This refactoring aims to enhance maintainability, readability, and consistency while adhering to SOLID principles.Background
Currently, each core operation manages its own metadata logic, leading to code duplication and reduced clarity. Centralizing this functionality will streamline the codebase and ensure uniform metadata management.
Proposed Changes
Create
withMetadata
HOF:src/utils/operations/withMetadata.ts
operationType
: Type of operation (e.g.,find
,update
).params
: Essential metadata parameters (spreadsheetId
,sheetId
,ranges
,userId
).configs
: Configuration options (e.g.,includeMetadata
).callback
: Core operation function.Refactor Core Operations:
findFirst
,findMany
,updateFirst
, etc.withMetadata
to handle metadata.Update Type Definitions:
null
forfindFirst
and appropriate types for other operations.Enhance Testing:
withMetadata
to verify proper metadata handling.Benefits
withMetadata
can be used across all operations, reducing duplication.Acceptance Criteria
withMetadata
is implemented and correctly handles metadata for all core operations.withMetadata
.Tasks
Implement
withMetadata
:Refactor Core Operations:
withMetadata
, ensuring separation of concerns.Update Types and Tests:
Documentation:
Code Review:
The text was updated successfully, but these errors were encountered: