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

Feature Request: Bring back Partial Upsert #1019

Closed
shyamal890 opened this issue May 5, 2018 · 7 comments
Closed

Feature Request: Bring back Partial Upsert #1019

shyamal890 opened this issue May 5, 2018 · 7 comments

Comments

@shyamal890
Copy link

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ x] Feature request
[ ] Documentation issue or request

What is the current behavior?

Upsert/UpsertMany in version 6 only supports a fully qualified entity. This doesn't allow for a partial update of the entity with upsert.

Expected behavior:

  • Bring back partial updates.
@gioragutt
Copy link

gioragutt commented May 7, 2018

Also noticed, that the generated schematics code produces incorrect code, where the actions receive an Update, whereas the adapter doesn't.

@MattiJarvinen
Copy link

Partial entities in the store are messy.

You have updateOne & updateMany https://github.com/ngrx/platform/blob/master/modules/entity/src/sorted_state_adapter.ts#L178-L189

@gioragutt
Copy link

@MattiJarvinen-BA you might be right, but currently, using the code as they "suggest it" (via ng g entity) simply doesn't work, since types don't align any more.
I've removed the upsert actions from my code since I didn't use them anyway, but it still doesn't change the fact that the generated code should align with the library usage.

@timdeschryver
Copy link
Member

@gioragutt #1042 keeps the generated code aligned.

@capaneus
Copy link

Hi,
I have been trying ngrx 6. And this stuck me a bit now since the code was working in 5.x doesn't work now with partial change. Just wonder if anyone have example code to build the entity with partial entity data changed to be passed to upsert? thanks a lot!

@MattiJarvinen
Copy link

@capaneus Could you please explain why update doesn't work for you? Can the user update items that aren't in the store in the first place?

@galenp
Copy link

galenp commented Jun 29, 2018

Can this please be re-opened?

My use case;

I use NGRX Store 5.5 to track partial updates for my entities that are batched together before doing a bulk partial update to Firestore.

This is a cost mitigation strategy to batch the partial saves in the Store to reduce the number of writes sent to Firestore each time. A more managed debounce so to speak.

The system worked quite well.

With NGRX 6 upsertOne no longer having support for partial entities... I've lost the API to add a "new" partial change to the store.

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

7 participants