I think finalize() operator is actually correct. 사용자가 마우스 클릭을… If this subscription is already in an closed state, the passed tear down logic will be executed immediately. There is an alias called finallyAction for browsers

rxjs subscribe finally 2021