You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using insertElement to do optimistic update on the client side cache it would be useful to shomehow be able to determine the index to insert at from the already existing elements in the array.
For example say we should insert this entity:
{id: 134234,sortNo: 2}
into this list
[{id: 344,sortNo: 1},{id: 4543,sortNo: 5}]
The new entity should be inserted at index 1 but this is hard to tell without knowing the existing items in the list.
One way of solving it would be to allow the index parameter to insertElement to be a function that will receive all existing items in the list (or the whole cache) and return the index. This however would make the patch un-serializable as functions cannot be sent across the network. So it would only work in a client-side context.
The text was updated successfully, but these errors were encountered:
When using
insertElement
to do optimistic update on the client side cache it would be useful to shomehow be able to determine the index to insert at from the already existing elements in the array.For example say we should insert this entity:
into this list
The new entity should be inserted at index 1 but this is hard to tell without knowing the existing items in the list.
One way of solving it would be to allow the
index
parameter toinsertElement
to be a function that will receive all existing items in the list (or the whole cache) and return the index. This however would make the patch un-serializable as functions cannot be sent across the network. So it would only work in a client-side context.The text was updated successfully, but these errors were encountered: