Changed documentation with DataSource to be up to date

Summary: Since there were large refactoring's done to `DataSource` during the milestone for side-by-side panels, wanted to update some of the documentation as well so that the information is accurate and up to date.

Reviewed By: mweststrate

Differential Revision: D38541404

fbshipit-source-id: a6ba472f881fb8cbfa90ff5ac295a0b87c595080
This commit is contained in:
Feiyu Wong
2022-08-12 08:47:06 -07:00
committed by Facebook GitHub Bot
parent b7c38556ce
commit 02c21f5cb0
2 changed files with 16 additions and 4 deletions

View File

@@ -438,6 +438,13 @@ export class DataSource<T extends any, KeyType = never> {
return newView;
}
/**
* Returns a new view of the `DataSource` if there doesn't exist a `DataSourceView` with the `viewId` passed in.
* The view will allow different filters and sortings on the `DataSource` which can be helpful in cases
* where multiple tables/views are needed.
* @param viewId id for the `DataSourceView`
* @returns `DataSourceView` that corresponds to the `viewId`
*/
public getAdditionalView(viewId: string): DataSourceView<T, KeyType> {
if (viewId in this.additionalViews) {
return this.additionalViews[viewId];