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

Decomposition of load Method and Performance Optimization for saveAll in Reactive-Model Package #21

Open
jircdev opened this issue Jan 10, 2024 · 0 comments
Assignees

Comments

@jircdev
Copy link
Owner

jircdev commented Jan 10, 2024

File: library\modules\entities\collection\local-provider.ts
Context: The load method in the reactive-model package currently encompasses multiple responsibilities, including initializing the provider, handling pagination, filtering, sorting, and data fetching.

Problem: The method's extensive scope makes it challenging to read, maintain, and test.

Proposed Solution:

  1. Splitting Initialization Logic: Extract the provider initialization into a separate method named initializeProvider.
  2. Isolating Pagination Logic: Create a calculatePagination method to handle the computation of total pages and current offsets.
  3. Dedicated Data Fetching Method: Separate the data fetching process into its own method, fetchData.
  4. Extracting Filtering and Sorting Logic: Move filtering and sorting responsibilities to a new function called applyFiltersAndSorting.

Expected Outcome: Decomposing the load method will simplify each aspect of the process, enhancing the code's clarity and ease of maintenance.

veD-tnayrB added a commit that referenced this issue Jan 12, 2024
jircdev added a commit that referenced this issue Jan 15, 2024
Solve #21 Refactoring of LocalProvider for Collections
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

No branches or pull requests

2 participants