Skip to content

Enh: Disconnect on <CentProvider> unmount #12

@Vovan-VE

Description

@Vovan-VE

<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)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions