delegato

A mixin that provides a @delegates class method.

npm install delegato
4 downloads in the last day
56 downloads in the last week
216 downloads in the last month

delegato Build Status

Delegate Methods

Delegato = require 'delegato'

class Ship
  Delegato.includeInto(this)

  @delegatesMethods 'dropAnchor', 'raiseAnchor', toProperty: 'winch'
  @delegatesMethod 'leavePort', toMethod: 'getCaptain'

Delegate Properties

class MyClass
  Delegato.includeInto(this)

  @delegatesProperty 'steamPressure', toProperty: 'engineRoom'
  @delegatesProperties 'heading', 'speed', toMethod: 'getVelocity'
npm loves you