So I thought why not store all the data in one object, that is, I have an EventEmitter object and I had an idea why not to store data in it. that is, to be

var myee = new EventEmitter(); myee.on() myee.data = [] myee.objects = {data: value} 

How bad it can be in terms of littering an EventEmitter object

  • This can be done and this is common practice. read the source of any module, even the same request - nörbörnën
  • It is clear that he is an object in Africa and an object; he is more interested in how the V8 belongs to such a combination, if it does not reset the optimization in such a neighborhood. - pnp2000
  • what kind of optimization? EventEmitter has removeAllListeners, call it when the object is no longer needed and then the garbage collector will definitely not have problems - nörbörnën
  • Yes, V8 has a lot of problems, for example, the famous bug with division by zero, well, not a bug, but a feature, that is, if somewhere in the calculations of a canvas one of the coordinates will become zero and it will be divided then all the optimization of the function where it happened will be removed, and there are enough moments a lot, it is from here that the question has arisen is it a good practice to store everything in one object - pnp2000

0