bloc icon indicating copy to clipboard operation
bloc copied to clipboard

question: Could you please enhance your 'Infinite list' example from docs?

Open AlexanderFarkas opened this issue 4 years ago • 7 comments

It would be great to see, how to properly implement refreshing + pagination + search.

AlexanderFarkas avatar Sep 23 '21 16:09 AlexanderFarkas

Hi @AlexandrFarkas 👋 Thanks for opening an issue!

This is a great idea and in the meantime some existing references are:

felangel avatar Sep 23 '21 16:09 felangel

Hi @felangel Well, I would like to see them in conjunction.

  • How to avoid race condition between event handlers.
  • How to debounce search events
  • How to throttle refresh and next page events (droppable strategy)
  • How to allow other events process normally (without throttling and debounce)

AlexanderFarkas avatar Sep 23 '21 16:09 AlexanderFarkas

"How to avoid race condition between event handlers." is important. For example, I don't want nextPage completed, when user already called refresh. It might happen that refresh emits new items first, and nextPage (after long request) applies new portion from previous result. It either messes up pagination or overrides refresh results (depending on implementation).

AlexanderFarkas avatar Sep 24 '21 06:09 AlexanderFarkas

Handling the race conditions in this case is available with the restartable transformer right?

chenyair avatar Sep 26 '21 08:09 chenyair

This is a great opportunity to showoff the new concurrency features

Gene-Dana avatar Oct 20 '21 15:10 Gene-Dana

I guess one way to achieve this is to have a cancelable operations (or cancelable requests if dealing with http API) and have an event debouncer (e.g. rxdart's debounce extension).

iandis avatar Jan 09 '22 19:01 iandis