0.2.1 • Published 6 years ago

@1amageek/flow v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

flow.ts

Flow enables coding of structured scripts.

Installation

yarn add @1amageek/flow

Usage

class Item implements Flow.Dependency {
    status?: string
}
var item: Item = new Item()

const step0: Flow.Step<Item> = new Flow.Step((item) => {
    // Do something
    return item
})

const step1: Flow.Step<Item> = new Flow.Step( async (item) => {
    try {
        return await asyncFunction()
    } catch(err) {
        // Error handling
        throw(err)
    }
})

const step2: Flow.Step<Item> = new Flow.Step((item) => {
    // Do something
    return item
})

const flow: Flow.Line<Item> = new Flow.Line([step0, step1, step2])

try {
    await flow.run(item)
} catch(error) {
    // Error handling
}   
0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago