1.0.0 • Published 10 years ago

industry-chain v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

IndustryChain Build Status

Chain synchronous or async methods using a common parameter namespace.

Requirements

This extension must be paired with StandardIO and Functions.

Usage

import { factory } from "industry"
import { chain } from "industry-chain"
import { instance } from "industry-instance"
import { functions } from "industry-functions"
import { standard_io } from "industry-standard-io"

class Test {
  hello() {
    return [
      this.getHello,
      this.getWorld,
      this.log
    ]
  }

    getHello() { return { hello: "hello" } }
    
    getWorld({ promise: { resolve } }) {
      setTimeout(() => resolve({ world: "world" }), 10)
    }
    
    log({ hello, world }) { console.log(`${hello} ${world}`) }
}

let test = factory(Test)
  .set("instance", instance)
  .set("functions", functions)
  .set("standard_io", standard_io)
  .set("chain", chain)

test().hello()
  // hello world!
1.0.0

10 years ago

0.5.2

10 years ago

0.5.1

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago