T
- the data type of items in the listpublic static class HasDataPresenter extends Object
Presenter implementation of HasData
that presents data for various
cell based widgets. This class contains most of the shared logic used by
these widgets, making it easier to test the common code.
In proper MVP design, user code would interact with the presenter. However, that would complicate the widget code. Instead, each widget owns its own presenter and contains its own View. The widget forwards commands through to the presenter, which then updates the widget via the view. This keeps the user facing API simpler.
Updates are not pushed to the view immediately. Instead, the presenter
collects updates and resolves them all in a finally command. This reduces the
total number of DOM manipulations, and makes it easier to handle side effects
in user code triggered by the rendering pass. The view is responsible for
called #flush()
to force the presenter to synchronize the view when
needed.
Copyright © 2018. All rights reserved.