Skip to content

Functions should work without chaining #31

@jonahkagan

Description

@jonahkagan

In the spirit of being more like Underscore, chaining should be optional syntax. Understream functions should stand alone, taking a (Readable) stream as an explicit first argument.

Chaining can be a clunky syntax when only one or two transformations will be applied. Furthermore, it implies that pipelines should be linear, which does not necessarily gel with the actual operations (like join or its inverse, partition).

For example, instead of writing this:

_.stream(stream).map(some_fun).stream()

I should be able to write:

_.map stream, some_fun

and get back a Readable stream in which some_fun is applied to each chunk.

Since this creates a name clash, I think mixing into Underscore should be dropped in favor of a new Understream variable. Some ideas: _s, us, understream, _stream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions