Skip to content

Stream doesn't close when giving empty array #2

@amishas157

Description

@amishas157

Following is the code snippet I am running:

'use strict';
const streamifyArray = require('streamify-array');

let stream = streamifyArray([]);
stream.on('end', () => console.log('Done!'))

When streamifying an empty array, the stream never encounters the end handler. But on adding data handler as below, it encounters the stream end handler.

'use strict';
const streamifyArray = require('streamify-array');

let stream = streamifyArray([]);
stream.on('data', () => {});
stream.on('end', () => console.log('Done!'));

I am not sure why it needs data handler in to reach the end handler. @rubensworks ,can you help me with this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions