Make DataView report window changes
Summary: Project: https://docs.google.com/document/d/1x-1ShlxXCM2od9JMO6PP14Cuqq0OrVe1Qd7FUwTos9A/edit Reviewed By: antonk52 Differential Revision: D44748055 fbshipit-source-id: 409c272b12fb29c156efdaa1ab26d4d6a2936645
This commit is contained in:
committed by
Facebook GitHub Bot
parent
4e898eb01a
commit
ff85744911
@@ -83,6 +83,11 @@ type OutputChange =
|
||||
// like: clear, filter or sorting change, etc
|
||||
type: 'reset';
|
||||
newCount: number;
|
||||
}
|
||||
| {
|
||||
type: 'windowChange';
|
||||
newStart: number;
|
||||
newEnd: number;
|
||||
};
|
||||
|
||||
export type DataSourceOptionKey<K extends PropertyKey> = {
|
||||
@@ -582,6 +587,11 @@ export class DataSourceView<T, KeyType> {
|
||||
public setWindow(start: number, end: number) {
|
||||
this.windowStart = start;
|
||||
this.windowEnd = end;
|
||||
this.notifyAllListeners({
|
||||
type: 'windowChange',
|
||||
newStart: start,
|
||||
newEnd: end,
|
||||
});
|
||||
}
|
||||
|
||||
public addListener(listener: (change: OutputChange) => void) {
|
||||
|
||||
Reference in New Issue
Block a user