All data source status is here, including data source instance status and data status (for QueriableDataSource).
- Instance status includes: NotCreated, Created, CreateError.
When a data source is requested to be created, it is set to
NotCreatedat first. If a data source has never been used, there is no data source status.
- Data status includes: NotReady, Unloaded, Loading, Loaded, LoadError.
When a QueriableDataSource is created, it is set as
Unloadedat first. If the data source is generated by widgets, the initial status will be
NotReady, otherwise the initial status will be
Unloaded. When widgets are ready to generate data, that is to say, the data source is ready to do query, widgets will change the status from
Unloaded. When widgets are not ready to generate data, widgets will change the status back to
NotReady, then framework will help to clear source records, records and cache in data source instance. If
load()is invoked, it will be set as
Loading. If data is returned, it will be set as
Loaded. If an error occurs, it will be set as
NotReady is for widget output data source only. When output data source instance is created, the data is not ready for use. Widget should dispatch an action (DataSourceStatusChanged) to make the data source ready for use. If a data source status is not ready, the query should return an empty result.