unherit

WebJar for unherit

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

unherit
Last Version

Last Version

1.1.3
Release Date

Release Date

Type

Type

jar
Description

Description

unherit
WebJar for unherit
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/wooorm/unherit

Download unherit

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/unherit/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>unherit</artifactId>
    <version>1.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/unherit/
implementation 'org.webjars.npm:unherit:1.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/unherit/
implementation ("org.webjars.npm:unherit:1.1.3")
'org.webjars.npm:unherit:jar:1.1.3'
<dependency org="org.webjars.npm" name="unherit" rev="1.1.3">
  <artifact name="unherit" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='unherit', version='1.1.3')
)
libraryDependencies += "org.webjars.npm" % "unherit" % "1.1.3"
[org.webjars.npm/unherit "1.1.3"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : inherits jar [2.0.0,3)
org.webjars.npm : xtend jar [4.0.0,5)

Project Modules

There are no modules declared in this project.

unherit

Build Coverage Downloads Size

Create a custom constructor which can be modified without affecting the original class.

Install

npm:

npm install unherit

Use

var EventEmitter = require('events').EventEmitter
var unherit = require('unherit')

// Create a private class which acts just like `EventEmitter`.
var Emitter = unherit(EventEmitter)

Emitter.prototype.defaultMaxListeners = 0
// Now, all instances of `Emitter` have no maximum listeners, without affecting
// other `EventEmitter`s.

new Emitter().defaultMaxListeners === 0 // => true
new EventEmitter().defaultMaxListeners === undefined // => true
new Emitter() instanceof EventEmitter // => true

API

unherit(Super)

Create a custom constructor which can be modified without affecting the original class.

Parameters
  • Super (Function) — Super-class
Returns

Function — Constructor acting like Super, which can be modified without affecting the original class.

License

MIT © Titus Wormer

Versions

Version
1.1.3
1.1.2
1.1.1
1.1.0