epoxy-adapter / com.airbnb.epoxy / EpoxyController / requestDelayedModelBuild

requestDelayedModelBuild

open fun requestDelayedModelBuild(delayMs: Int): Unit

Call this to request a delayed model update. The controller will schedule a call to so that models can be rebuilt for the current data.

Using this to delay a model update may be helpful in cases where user input is causing many rapid changes in the models, such as typing. In that case, the view is already updated on screen and constantly rebuilding models is potentially slow and unnecessary. The downside to delaying the model build too long is that models will not be in sync with the data or view, and scrolling the view offscreen and back onscreen will cause the model to bind old data.

If a previous request is still pending it will be removed in favor of this new delay

Any call to #requestModelBuild() will override a delayed request.

In most cases you should use #requestModelBuild() instead of this.

Parameters

delayMs - Int: The time in milliseconds to delay the model build by. Should be greater than or equal to 0. A value of 0 is equivalent to calling #requestModelBuild()