lrud icon indicating copy to clipboard operation
lrud copied to clipboard

Asyncronous adding items at higher index than total list count

Open dseeker opened this issue 5 years ago • 0 comments

Is your feature request related to a problem? Please describe. When building the UI, the application is asynchronously loading content separately for 3 components. Depending on the API response time, some are finished before others. They index ordering is 0,1,2 but they may get built in random order (register 2, register 0, register 1). I'm passing the index on the registration command, but if I add a node with index 2 on a list of 1 node, it will get added in index 1, thus conflicting with the subsequent node.

Describe the solution you'd like The node should be added in the correct index even with a shorter list. Perhaps lrud could add a "ghost" or temporary node between the non existing node index, and replace it with the real node when it gets registered with that index

Describe alternatives you've considered Having an abstraction that will receive the registration events but only passing them to lrud once all of them are loaded, but it seems like the library should be able to handle that by itself

dseeker avatar Nov 19 '20 15:11 dseeker