Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rails-delegate

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rails-delegate - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

tags

2

package.json
{
"name": "rails-delegate",
"version": "0.4.0",
"version": "0.4.1",
"description": "A simple helper to implement the delegation pattern in JavaScript code bases",

@@ -5,0 +5,0 @@ "main": "lib/rails-delegate.js",

@@ -15,2 +15,4 @@ # Delegation Pattern for JavaScript

## Delegating methods
```javascript

@@ -38,3 +40,18 @@ delegate = require('rails-delegate');

## Delegating Events
You can also forward events emitted by wrapped classes.
```javascript
function Car() {
this.engine = new Engine();
delegateEvents('starting', 'stopping', { from: this.engine, to: this });
};
```
Now if `myCar.engine` emits a starting `starting` event,
`myCar` also emits that event.
## Alternatives

@@ -41,0 +58,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc