Skip to content
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

Feature request: pluggable transports #21

Closed
emdin opened this issue Oct 30, 2014 · 2 comments
Closed

Feature request: pluggable transports #21

emdin opened this issue Oct 30, 2014 · 2 comments

Comments

@emdin
Copy link

emdin commented Oct 30, 2014

Ampersand-sync can be upgraded to work on server, to do so xhr or any other transport should be pluggable. Something along the lines:

var request = require('request');
var xhr = require('xhr');
var sync = require('ampersand-sync')({ 
    transport: (typeof window === 'undefined')? request: xhr 
});
@bear bear added the request label Oct 30, 2014
@bear bear added question and removed request labels Nov 12, 2014
@lukekarrys lukekarrys modified the milestone: v4.0 Jan 13, 2015
@naugtur
Copy link
Member

naugtur commented Jan 15, 2015

Is there an idea how you (maintainers) would like it to work? I could implement that while making the switch to xhr v2.0
I'd just prefer to know your opinion before I submit a PR

@naugtur
Copy link
Member

naugtur commented May 29, 2015

This got accidentally done in xhr2-and-node branch.

var sync = require("ampersand-sync/core")(whateverXhrYouWant)

Also, if you just wanted to switch between xhr for the browser and request for node, that's going to happen without any setup.

@naugtur naugtur closed this as completed Jul 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants