attach

Add attach functionality to a routable object.

Usage no npm install needed!

<script type="module">
  import attach from 'https://cdn.skypack.dev/attach';
</script>

README

Attach

Add attach functionality to a routable object.

Build Status

Installation

$ npm install attach

Usage

Attach adds functionality to attach components to each other.


// require it
var attach = require('attach'),
    routable = require('routable'),
    EventEmitter = require('events').EventEmitter,
    parent = new EventEmitter(),
    child = new EventEmitter();

// use it on your object
routable.extend(parent);
attach.extend(parent);

routable.extend(child);

parent.defineRoute('child', '/child');
parent.attach(child);

To Do

  • Write tests