fed135/ha-store

`setMaxListeners(Infinity)` call should probably be removed

Closed this issue · 1 comments

Describe the bug

The setMaxListeners(Infinity) call seems like a hidden bad idea. Letting EventEmitter print the warning when it goes over 10 listeners may help some consumers find that they were leaking listeners. It seems that this should just be removed and left to the consumer to raise / disable if they choose.

    if (this.setMaxListeners) {
      this.setMaxListeners(Infinity);
    }

ha-store/src/index.js

Lines 22 to 24 in c60ea82

if (this.setMaxListeners) {
this.setMaxListeners(Infinity);
}

To Reproduce
n/a

Expected behavior
Consumer should disable the event emitter listener limit if they choose to do so.

Additional context
Thoughts?

That's a fair point, I will remove it.