npm.io
1.0.0 • Published 8 years ago

uc-compose

Licence
MIT
Version
1.0.0
Deps
0
Size
3 kB
Vulns
0
Weekly
0

Unchained UI

Compose

Simple way to build complex components

Usage

import compose from 'uc-compose'
import { log, LOG_LEVEL } from 'uc-log'

const MyClass = function() {}
MyClass.prototype = compose(
  log,
  {
    logLevel: LOG_LEVEL.DEBUG,
    logName: 'My Class',
    method: function() {
      this.log(LOG_LEVEL.INFO, 'Hello')
    }
  }
)
Methods
compose(...args)

This function is just syntax sugar around Object.assign. It always returns new object. To extent existing object pass true as the last argument.

License MIT

velocityzen

Keywords