Skip to content

feat(table): add disconnect to data source #5382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 29, 2017

Conversation

andrewseguin
Copy link
Contributor

Disconnects the data source when it is no longer used, either by the table being destroyed or another data source taking its place

@andrewseguin andrewseguin requested a review from jelbourn June 27, 2017 20:03
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jun 27, 2017
@@ -14,4 +14,5 @@ export interface CollectionViewer {

export abstract class DataSource<T> {
abstract connect(collectionViewer: CollectionViewer): Observable<T[]>;
disconnect() {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass the collectionViewer to the data source?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me, but it does require that all data sources need to implement it now. At least a no-op

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also mark disconnect as optional.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Jun 27, 2017
@tinayuangao
Copy link
Contributor

Please fix the test

@tinayuangao
Copy link
Contributor

@andrewseguin Please rebase again. Thanks

@andrewseguin
Copy link
Contributor Author

andrewseguin commented Jun 29, 2017

Rebased

@tinayuangao tinayuangao merged commit 9fe62f9 into angular:master Jun 29, 2017
amcdnl pushed a commit to amcdnl/material2 that referenced this pull request Jul 8, 2017
* feat(data-table): add disconnect to data source

* testing

* add collectionviewer to disconnect
@andrewseguin andrewseguin deleted the table-disconnect branch November 28, 2017 20:36
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants