Skip to content

Commit 573ef49

Browse files
feat(gallery-web): implement loader controller on gallery store
1 parent b5f444d commit 573ef49

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/pluggableWidgets/gallery-web/src/stores/GalleryStore.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { SortAPI } from "@mendix/widget-plugin-sorting/react/context";
1111
import { SortStoreHost } from "@mendix/widget-plugin-sorting/stores/SortStoreHost";
1212
import { EditableValue, ListValue } from "mendix";
1313
import { PaginationEnum, StateStorageTypeEnum } from "../../typings/GalleryProps";
14+
import { DerivedLoaderController } from "../controllers/DerivedLoaderController";
1415
import { QueryParamsController } from "../controllers/QueryParamsController";
1516
import { ObservableStorage } from "../typings/storage";
1617
import { AttributeStorage } from "./AttributeStorage";
@@ -31,6 +32,7 @@ interface StaticProps {
3132
stateStorageType: StateStorageTypeEnum;
3233
storeFilters: boolean;
3334
storeSort: boolean;
35+
refreshIndicator: boolean;
3436
}
3537

3638
export type GalleryPropsGate = DerivedPropsGate<DynamicProps>;
@@ -50,6 +52,7 @@ export class GalleryStore extends BaseControllerHost {
5052
readonly paging: PaginationController;
5153
readonly filterAPI: FilterAPI;
5254
readonly sortAPI: SortAPI;
55+
loaderCtrl: DerivedLoaderController;
5356

5457
constructor(spec: GalleryStoreSpec) {
5558
super();
@@ -86,6 +89,14 @@ export class GalleryStore extends BaseControllerHost {
8689
host: this._sortHost
8790
};
8891

92+
this.loaderCtrl = new DerivedLoaderController({
93+
refreshIndicator: spec.refreshIndicator,
94+
query: {
95+
isRefreshing: this._query.isRefreshing,
96+
isSilentRefresh: this._query.isSilentRefresh
97+
}
98+
});
99+
89100
new RefreshController(this, {
90101
delay: 0,
91102
query: this._query.derivedQuery

0 commit comments

Comments
 (0)