Skip to content

do not use an instantiated Instapush() as the exports value #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mrose17
Copy link

@mrose17 mrose17 commented May 15, 2014

otherwise when require'd, the caller can not make more than one Instapush object...

mrose17 added 2 commits May 15, 2014 10:08
otherwise when require'd, the caller can not make more than one
Instapush object
@mrose17
Copy link
Author

mrose17 commented Jul 22, 2014

ping!

@mjpearson
Copy link

+1 this breaks for multi-user setups. The require subsystem caches the 'new Instapush()' singleton.

Until this change is merged/managed, have to hijack the prototype for a new instance, messy and can't anticipate any release changes :

var InstapushClient = function() {
  this.version = 'v1'; 
  this.url = 'api.instapush.im';
}

InstapushClient.prototype = require('instapush').__proto__;

var ipc = new InstapushClient();

@hybridknight
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants