When consuming the stream events, in order to get a representation of a full feed and list of entries in Javascript objects, one might have code such as this:
It appears that the 'feed' event is the last to fire when parsing a feed, therefore a good point to return a populated object. However, is that definitely always the case? Normally, I'd use the 'end' event to determine this, but it seems that in eventMode this does not get emitted.
Yes, in eventMode, 'feed' is the last event, provided that the source XML contains a channel or a feed element. If not, parsing fails emitting 'error'.
When consuming the stream events, in order to get a representation of a full feed and list of entries in Javascript objects, one might have code such as this:
It appears that the 'feed' event is the last to fire when parsing a feed, therefore a good point to return a populated object. However, is that definitely always the case? Normally, I'd use the
'end'
event to determine this, but it seems that in eventMode this does not get emitted.