Should there be a guard in place where calling this.unsubscribe() when there are no active listeners on the object? Calling it twice generates an error and it would be nice if the module remembered the state and didn't call it if it wasn't necessary.
Having this guard in place would eliminate a lot of code in my project that's checking this.
Should there be a guard in place where calling
this.unsubscribe()
when there are no active listeners on the object? Calling it twice generates an error and it would be nice if the module remembered the state and didn't call it if it wasn't necessary.Having this guard in place would eliminate a lot of code in my project that's checking this.