mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 01:41:31 +00:00
Initial Move from Azure DevOps to GitHub
This commit is contained in:
26
src/Explorer/Tables/DataTable/CacheBase.ts
Normal file
26
src/Explorer/Tables/DataTable/CacheBase.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
abstract class CacheBase<T> {
|
||||
public data: T[];
|
||||
public sortOrder: any;
|
||||
public serverCallInProgress: boolean;
|
||||
|
||||
constructor() {
|
||||
this.data = null;
|
||||
this.sortOrder = null;
|
||||
this.serverCallInProgress = false;
|
||||
}
|
||||
|
||||
public get length(): number {
|
||||
return this.data ? this.data.length : 0;
|
||||
}
|
||||
|
||||
public clear() {
|
||||
this.preClear();
|
||||
this.data = null;
|
||||
this.sortOrder = null;
|
||||
this.serverCallInProgress = false;
|
||||
}
|
||||
|
||||
protected abstract preClear(): void;
|
||||
}
|
||||
|
||||
export default CacheBase;
|
||||
Reference in New Issue
Block a user