how to cancel RXJS subscribe after a while

Viewed 4578

If the user's internet is slow and the subscription is taking too long(more than 30 sec), I want to cancel it.

const k = this.firebase(user)
        .subscribe(data => {

           //some instructions

        },
        error => alert(error),
        () => console.log("finished"));
}
k.unsubscribe();
2 Answers
Related