UNPKG

faye

Version:

Simple pub/sub messaging for the web

24 lines (17 loc) 473 B
'use strict'; var assign = require('./assign'); module.exports = function(parent, methods) { if (typeof parent !== 'function') { methods = parent; parent = Object; } var klass = function() { if (!this.initialize) return this; return this.initialize.apply(this, arguments) || this; }; var bridge = function() {}; bridge.prototype = parent.prototype; klass.prototype = new bridge(); assign(klass.prototype, methods); return klass; };