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: Async Connection via async feathersClient #104

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

Conversation

frank-dspeed
Copy link

@frank-dspeed frank-dspeed commented Feb 2, 2018

This changes nothing from the existing API it adds only the option to supply a promise as feathers client i need this feature and think its usefull for any one who does newer coding styles and does things like i do:

frathers-client-async.js

/* global window */
import loader from '@loader';

let clientUrl;

if (window && window.fetch) {
  clientUrl = '~/models/feathers/v3/feathers-client.socketio.js';
} else {
  clientUrl = '~/models/feathers/v3/feathers-client.rest.js';
} 

export const feathersClient = loader.import(clientUrl).then((module)=>{ return module.feathersClient; }, err=>{
  new Error('Feathers-client Error '+ clientUrl,err);
}); 


export default feathersClient;

Usage

This changes nothing from the existing API it adds only the option to supply a promise as feathers client i need this feature and think its usefull for any one who does newer coding styles and does things like i do:

frathers-client-async.js

```
/* global window */
import loader from '@loader';

let clientUrl;

if (window && window.fetch) {
  clientUrl = '~/models/feathers/v3/feathers-client.socketio.js';
} else {
  clientUrl = '~/models/feathers/v3/feathers-client.rest.js';
} 

export const feathersClient = loader.import(clientUrl).then((module)=>{ return module.feathersClient; }, err=>{
  new Error('Feathers-client Error '+ clientUrl,err);
}); 


export default feathersClient;
```
@marshallswain
Copy link
Member

@justinbmeyer I don't have the available time to check this out. Could you give it a look?

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.

None yet

2 participants