-
Notifications
You must be signed in to change notification settings - Fork 12
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: Partial Update actions. #72
Comments
Hey there! I'm a new (and temporary) addition to the team here, and I just wanted to hop in and tell you we're looking into this and have done a bit of brainstorming on the subject. Unfortunately, we don't have anything concrete we can share just yet, but we'll keep you in the loop when that changes. Thanks for your time! :) |
@mxdmedia Thanks for the feature request. We are brainstorming the best option here, as we do agree partial updates are a very useful feature. The key in how to do it revolves around the entity key, as we need it to find the right entity to update. We are not yet sure if we just want to make partial update of existing entities in state the default behavior, or whether to make that an explicit request on the developer's part (which will likely just end up being another optional parameter to the existing Update actions.) Since we have already separated the concept of Replace vs. Update, it may simply come down to updates by default always allowing partial, fundamental to their nature, with Replace being the way of updating an object in state (and in your remote store) with an entirely new and different version/copy. |
@mxdmedia I am considering something along the lines of a I'd like to limit how much we add to auto-entity, however I do understand that there will be cases where custom effects need to involve custom ngrx actions, or other auto-entity actions, and the need to custom patch data in the auto-entity state. To that end, I think a general use This feature still needs thought and review, but it is a feature I think we could add fairly quickly once we get all the details sorted out. |
Still using and really happy about how auto-entity works! As you may have gathered from my prior issues, some of the entities I am using are a bit on the complex side. In the past, with the vanilla ngrx entity library, I utilized their partial update options quite a bit. I am wondering if such functionality might be within the realm of your plans for auto entity? For example, lets say I have the following models/entities:
If I update something related to the job, say add an employee on the job for a specific date, my API returns, along with the new
JobEmployee
data, an updatedjobActiveDates
for the job. Its return looks something like this:Currently, in my effect, i need to pull the job from the store, update the dates, then submit the updated job via
UpdateSuccess()
. I would be nice to have a utility action, sayPartialUpdateSuccess()
that takes an object with the Key, and fields to be updated. So I could do something like the following in my effect:Thoughts?
The text was updated successfully, but these errors were encountered: