Post

Sure but from like, a mental point of view? Do I copy parser state over and over again until I have all the data I need? In mutable version I would create a mutable object and push data one after the other. If it was just an array id probably use some kind of reducer, BUT…

If I’m reading a stream, how do I reduce it? Let’s say I have a file that consists of chunks, each chunk starts with a header where there is chunk type and body length, if type is equal to a type I need - I need to parse data, if not - skip based on length.

0 reposts0 likes