[go: up one dir, main page]

Skip to content

aretecode-forks/chain-able

 
 

Repository files navigation

⛓ chain-able

NPM version docs Dependencies fliphub BuildStatus Coverage Status Codacy Badge gzip size fluent

interfaces that describe their intentions

🗣 expressive

traditional

class Traditional {
  constructor() {
    this.data = {}
  }
  build(index, name, object) {
    this.data.index = index
    this.data.name = name
    this.data.object = object
  }
}
const classico = new Traditional()
classico.build(1, 'string', {object: true})

fluent

class Chain extends Chainable {
  constructor(parent) {
    super(parent)
    this.extend(['index', 'name', 'object'])
  }
}
const chain = new Chainable()
  .index(1)
  .name('string')
  .object(true)

🏰 benefits

writing an api using chain-able means:

  • write 1 api,
  • get 3 apis as a result!
    • 🍉 persistable, rehydratable, & transferrable configurations
    • ⛓ fluent/chainable api
    • 🍦 vanilla object syntax

🎁 features

🔗 links & more

Packages

No packages published

Languages

  • JavaScript 99.9%
  • Makefile 0.1%