Skip to content
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

Enh: Disconnect on <CentProvider> unmount #12

Open
Vovan-VE opened this issue May 18, 2018 · 1 comment
Open

Enh: Disconnect on <CentProvider> unmount #12

Vovan-VE opened this issue May 18, 2018 · 1 comment

Comments

@Vovan-VE
Copy link

<CentProvider> does not disconnect before unmount. It's designed to connect once on application init phase.

I wish to use centrifugo on one-two specific pages in SPA admin panel in a project. I want to connect to Centrifugo server on demand and disconnect then it is unneeded.

I believe it is possible with current available interface, but it whould be much appropriate just to add a counterpart for the following lines:

componentDidMount = () => {
this.cent.connect(this.props.onConnect)
}

@fortis
Copy link
Owner

fortis commented May 18, 2018

@Vovan-VE hi!

You right, manual control should also be available. I will try to fix it one of these days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants