canjs / can-connect-feathers

The FeathersJS client library for DoneJS and can-connect
https://canjs.com/doc/can-connect-feathers.html
MIT License
10 stars 4 forks source link

Outline API #13

Closed justinbmeyer closed 8 years ago

justinbmeyer commented 8 years ago

Use

var connectFeathersBehavior = require("can-connect-feathers");
var io = require("socket.io"); //-> want to use steal-socket.io in donejs ssr app
var feathers = require("feathers/client");

var socket = io("http://localhost:3030", {
 transports: ['websocket']
});
var feathersApp = feathers()
 .configure(socketio(socket))
 .configure(hooks())
 .configure(auth());

var feathersService = feathersApp.service("messages");

var connection = can.connect([behaviors..., realTimeBehavior, connectFeathersBehavior], {
  feathersService: feathersService
});

No need to call connection.createInstance, etc.

Options

feathersService {FeathersService}

data interface

getListData

getData

createData

updateData

destroyData

marshallswain commented 8 years ago

Session Use

const feathersSessionBehavior = require('can-connect-feathers/session');
const io = require('socket.io'); //-> want to use steal-socket.io in donejs ssr app
const feathers = require('feathers/client');
const socketio = require('feathers-socket.io/client');
const hooks = require('feathers-hooks');
const auth = require('feathers-authentication/client');

const socket = io('http://localhost:3030', {
 transports: ['websocket']
});
var feathersApp = feathers()
 .configure(socketio(socket))
 .configure(hooks())
 .configure(auth());

var connection = can.connect([behaviors..., realTimeBehavior, connectFeathersBehavior], {
  feathersApp: feathersApp
});

Options

feathersApp {FeathersApp}

data interface

createData

destroyData

marshallswain commented 8 years ago

Add getData