Skip to content

Have you try js-awe library to manage async and promises elegantly #1

@josuamanuel

Description

@josuamanuel

const { plan } = require("js-awe")

const result = plan().build([
val1 => Promise.resolve(val1 * 2), // fun1: 3*2 = 6
[val2 => Promise.resolve(val2 + 1), val3 => val3 + 3], // fun2A: 6 + 1 = 7; fun3: 7 + 3 = 10
[val2 => Promise.resolve(val2 - 1), val4 => val4 + 2], // fun2B: 6 - 1 = 5; fun4: 5 + 2 = 7
([val4, val5]) => val4 + val5 // fun5: 10 + 7 = 17; Promise.resolve(17)
])(3)

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