As I know about docs of ngrx/entity adapter
addOne: Add one entity to the collection upsertOne: Add or Update one entity in the collection updateOne: Update one entity in the collection
Why do we need upsertOne here while we have addOne and updateOne? So can I use only upsertOne for both case: add new item or update new item? The docs makes me confused a bit
updateOne
: add the entity to the collection, does nothing if the entity is already in the store state
upsertOne
: add the entity to the collection, updates the existing entity in the store if it's already present
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With