Skip to content

Is when.join(a, b, c, ...).spread(f) an anti-pattern? #322

@briancavalier

Description

@briancavalier

The exact same outcome can be achieved with:

// when.try does the same thing
var result = when.try(f, a, b, c, ...);

// or, if you want to be able to reuse or pass around a lifted f:
var fp = when.lift(f);
var result = fp(a, b, c, ...);

I think both when.join and promise.spread still have use cases separate from each other, but I'm having trouble seeing why using them together (when.join(a, b, c, ...).spread(f)) would have any advantages.

Anyone have any thoughts?

If it's true, then I'm not sure what to do, except to try harder to steer people toward when.try/lift in examples.

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