can-connect-feathers
Integrate can-connect with the FeathersJS Client
Object
can-connect-feathers
is a set of behaviors for integrating can-connect with Feathers Client.
- The service behavior connects to a Feathers service.
- The session behavior connects to the feathers-authentication-client methods on a Feathers Client instance.
Both of the included behaviors require a Feathers Client instance. Here is a basic setup:
// models/feathers.js
import feathers from "feathers/client";
import socketio from "feathers-socketio/client";
import io from "socket.io-client/dist/socket.io";
import hooks from "feathers-hooks";
import auth from "feathers-authentication-client";
const socket = io( "" );
const feathersClient = feathers()
.configure( hooks() )
.configure( socketio( socket ) )
.configure( auth() );
export default feathersClient;
Pro tip: If you are planning on using Done-SSR, exchange the
socket.io-client/dist/socket.io
module forsteal-socket.io
in the above example.