PCDCollection requires separate operations to add PCDs, and then set their folder. This is not only awkward to code, but it means there are intermediate states which shouldn't ever exist (where the new PCDs are in the root folder). The use of the emitter to notify listeners means that external code has a good chance of finding out about those intermediate states, including inside of internal code in PCDCollection such as applying feed actions, or merging.
I was considering some refactoring to avoid the extra emitter calls, but I think it would be cleaner to make folder an argument to addPCD() instead.
PCDCollection requires separate operations to add PCDs, and then set their folder. This is not only awkward to code, but it means there are intermediate states which shouldn't ever exist (where the new PCDs are in the root folder). The use of the emitter to notify listeners means that external code has a good chance of finding out about those intermediate states, including inside of internal code in PCDCollection such as applying feed actions, or merging.
I was considering some refactoring to avoid the extra emitter calls, but I think it would be cleaner to make folder an argument to addPCD() instead.