1.0.0 • Published 6 years ago

uc-compose v1.0.0

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

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