Akita: Upsert for array of items

Created on 25 Apr 2019  路  4Comments  路  Source: datorama/akita

I'm submitting a...

[X ] Bug report
[ ] Performance issue
[X ] Feature request
[ ] Documentation issue or request
[ ] Support request

Current behavior

No way to insert new items and update existing ones from an array at once.

  1. add() only adds new items, does not update the existing ones.
  2. update() only updates, does not add new ones.
  3. upsert() doesn't work with arrays.

Expected behavior

Allow upsert() to work with an array of items.

Most helpful comment

  1. We do not like your attitude or the way you speak.
  2. Upsert works with a class; you should provide a third option.
  3. Based on our Gitter talks, I recommend you to learn JS/TS/RxJS before using Angular or any state management library.
  4. You never provide a living example of your "issues".
  5. If you don't like Akita - don't use it.

Good Luck!

All 4 comments

Update: upsert() also does not copy over the prototype...sucks big time

upsert([id, id], state)

@NetanelBasal You didn't actually test that, did you? if state is array, this fails.

Also add(), update() copy prototype, uspert() does not, that's a clear inconsistency to me as there are many other quirks, issues and undocumented behaviour with Akita and given this kind of treatment to ideas and problems on hand (real use cases) we will obviously move to ditch Akita and replace it with something more suitable and in tune with reality.

  1. We do not like your attitude or the way you speak.
  2. Upsert works with a class; you should provide a third option.
  3. Based on our Gitter talks, I recommend you to learn JS/TS/RxJS before using Angular or any state management library.
  4. You never provide a living example of your "issues".
  5. If you don't like Akita - don't use it.

Good Luck!

Was this page helpful?
0 / 5 - 0 ratings