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

Remove items code duplication between stores #10870

Open
hassnian opened this issue Aug 20, 2024 · 0 comments · May be fixed by #11096
Open

Remove items code duplication between stores #10870

hassnian opened this issue Aug 20, 2024 · 0 comments · May be fixed by #11096
Assignees
Labels
A-refactoring Refactoring stuff, make code more readable, mitigating tech debt

Comments

@hassnian
Copy link
Contributor

hassnian commented Aug 20, 2024

after #10842

we might need to reuse the same logic in future stores

I'd like a solution that has less code duplication, ideally some utils

stores: listingCart, makeOffer

pls read thread


can we make some utils so we don't duplicate this code , and can reuse it in future stores :D

    setItem(payload: MakingOfferItem) {
         addItem(this.items, payload)
    },
    updateItem(payload: Partial<MakingOfferItem>) {
          updateItem(this.items, payload, payload.id)
    },
    removeItem(id: ID) {
      removeItem(this.items, id)
    },

Originally posted by @hassnian in #10842 (comment)

@hassnian hassnian added the A-refactoring Refactoring stuff, make code more readable, mitigating tech debt label Aug 20, 2024
@hassnian hassnian self-assigned this Oct 9, 2024
@hassnian hassnian linked a pull request Oct 9, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-refactoring Refactoring stuff, make code more readable, mitigating tech debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant