Skip to content

An option to fall through all the matchers #16

@avalanche1

Description

@avalanche1

I would like a feature to be able to not stop matching if any pattern matches and continue to run matchers (except for the default _, of course).

match(id,
        () => typeof id === 'string', () => doEffect1,
        () => typeof id === 'string' && id.length > 5, () => doEffect2,
        () => typeof id === 'number', () => doEffect3,
        _,  (x) => x
);

Here if id === 'foobar' I would like to effects 1 and 2 to run.
In cur lib version it would do effect 1 and stop.
What I ask is similar to switch statement without breaks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions