You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.
Seems a pretty dumb question but how can I define my feathers client in one javascript file and use it in multiple other files (whithout having to pass it as a variable parametter)
If I do something like this:
server.js
import 'babel-polyfill';
import feathers from 'feathers/client'
import hooks from 'feathers-hooks';
import rest from 'feathers-rest/client'
import authentication from 'feathers-authentication/client';
import localstorage from 'feathers-localstorage';
export default const app = feathers()
.configure(rest(host).fetch(fetch))
.configure(hooks())
.configure(authentication({
storage: AsyncStorage
}));
userHandler.js
import {app} from 'server.js;
...
app.service('users').create(userData).then((result) => {
...
}
messageHandler.js
import {app} from 'server.js;
...
app.service('messages').create(messageData).then((result) => {
...
}
appears that the feathersjs app configuration would be rerun at each import call. So is there a way to configure the feathers client in a static way and to reuse it in other javascript files with import (so without having to pass the app as a variable parametter from class to class)?
The text was updated successfully, but these errors were encountered:
Seems a pretty dumb question but how can I define my feathers client in one javascript file and use it in multiple other files (whithout having to pass it as a variable parametter)
If I do something like this:
server.js
userHandler.js
messageHandler.js
appears that the feathersjs app configuration would be rerun at each import call. So is there a way to configure the feathers client in a static way and to reuse it in other javascript files with import (so without having to pass the app as a variable parametter from class to class)?
The text was updated successfully, but these errors were encountered: