1.0.6 • Published 7 years ago

extend-with v1.0.6

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

alt tag

How to use?

class SuperMan {}

const withSupermanLevitation =
  (superClass) => class extends superClass {
    static levitation = 'levitation'
  }

const withSupermanTelekinesis =
  (superClass, value) => class extends superClass {
    static telekinesis = value
  }

const SupermanExtended =
  extend(Superman).with(
    withSupermanLevitation,
    [withSupermanTelekinesis, 'telekinesis'] // with arguments
  )

console.log(
  SupermanExtended.levitation,  // => 'levitation'
  SupermanExtended.telekinesis, // => 'telekinesis'
)
1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago