Const NgStoreListMediator
NgStoreListMediator: any = ListMediator.extend({init: function(settings: IListMediatorCtorOptions) {const self: INgStoreListMediatorDev = this;self._super(settings);self._ngStore = null;},setNgStore: function <T extends ICollectionItem>(store: ICollectionStore<T>): void {const self: INgStoreListMediatorDev = this;self._ngStore = store;},getNgStore: function <T extends ICollectionItem>(): ICollectionStore<T> {const self: INgStoreListMediatorDev = this;return self._ngStore;},safelyReadDataProvider: function(): any[] {const self: INgStoreListMediatorDev = this;const models = self._super();// Safely push these models into view level data providerself._ngStore.add(models);// Then returnreturn models;},/*** Override.* This method uses the data from the ngstore, instead of the* the current remote data provider, to generate the list of data* to be rendered.*/renderData: function(async?: boolean) {const self: INgStoreListMediatorDev = this;const $data = self._viewInstance.$data;$data.clean();$data.hasMoreData(self._dataProvider.hasNextPage());const subscription = self._ngStore.getState().subscribe(savedData => {const newData = self.generateItemsInternal(savedData.items);if (async === true) {$data.asyncPush(newData);} else {$data.syncPush(newData);}setTimeout(() => {subscription.unsubscribe();}, 1);});}})