Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

should we ship requestReset()? #26

Closed
valdrinkoshi opened this issue Apr 21, 2018 · 3 comments
Closed

should we ship requestReset()? #26

valdrinkoshi opened this issue Apr 21, 2018 · 3 comments

Comments

@valdrinkoshi
Copy link
Collaborator

<virtual-list> currently exposes the requestReset() method as a mean to trigger a rerendering of the DOM. This is useful for users that want to keep the same items array instance, perform an arbitrary number of updates to it, and decide when to trigger the rerendering.

Should we expose such method?

Other possible solutions:

  1. always trigger the rerendering when items is set
  2. require the user to provide a new items array instance to trigger the update

If we want to keep this method, what would be a better name for it?

@valdrinkoshi
Copy link
Collaborator Author

Another scenario where the user needs something like requestReset() is when the DOM size changes with animations, e.g. expand row to show more details with an animation http://jsbin.com/galuhe/1/edit?html,output - but maybe this can be addressed with ResizeObservers?

@domenic
Copy link
Collaborator

domenic commented May 14, 2018

So ideally IMO we never ask the user to use requestReset() for rendering-related reasons (like animations), but always use it for data-related reasons.

@domenic
Copy link
Collaborator

domenic commented May 25, 2018

Let's roll this into #70, since that will help realize the "always use requestReset/itemsChanged for data-related reasons" vision.

@domenic domenic closed this as completed May 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants