Skip to content
Snippets Groups Projects
Commit dc764ddc authored by Xiao Gui's avatar Xiao Gui
Browse files

debug: debounce to fetch the right dataset

parent 9127c8d7
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,11 @@ init().catch(e => {
console.warn(`dataset init failed`, e)
})
datasetsRouter.use((req, res, next) => {
res.setHeader('Cache-Control', 'no-cache')
next()
})
datasetsRouter.get('/templateName/:templateName', (req, res, next) => {
const { templateName } = req.params
getDatasets({ templateName })
......
import { Injectable, OnDestroy } from "@angular/core";
import { Store, select } from "@ngrx/store";
import { ViewerStateInterface, FETCHED_TEMPLATE, DataEntry, FETCHED_DATAENTRIES, safeFilter, FETCHED_SPATIAL_DATA, UPDATE_SPATIAL_DATA } from "../services/stateStore.service";
import { map, distinctUntilChanged } from "rxjs/operators";
import { map, distinctUntilChanged, debounceTime } from "rxjs/operators";
import { Subscription, combineLatest } from "rxjs";
import { AtlasViewerConstantsServices } from "./atlasViewer.constantService.service";
import { PluginManifest } from "./atlasViewer.pluginService.service";
......@@ -231,6 +231,8 @@ export class AtlasViewerDataService implements OnDestroy{
map(({parcellationSelected})=>(parcellationSelected.name)),
distinctUntilChanged()
)
).pipe(
debounceTime(16)
).subscribe((param : [string, string] ) => fetchData(param[0], param[1]))
)
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment