Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Mattchewone
Created December 14, 2018 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mattchewone/a8ce5fae0d342aedcf91c0117246423a to your computer and use it in GitHub Desktop.
Save Mattchewone/a8ce5fae0d342aedcf91c0117246423a to your computer and use it in GitHub Desktop.
import connect from 'can-connect'
import constructor from 'can-connect/constructor/constructor'
import canMap from 'can-connect/can/map/map'
import canRef from 'can-connect/can/ref/ref'
import constructorStore from 'can-connect/constructor/store/store'
import dataCallbacks from 'can-connect/data/callbacks/callbacks'
import combineRequests from 'can-connect/data/combine-requests/combine-requests'
import dataParse from 'can-connect/data/parse/parse'
import realTime from 'can-connect/real-time/real-time'
import callbacksOnce from 'can-connect/constructor/callbacks-once/callbacks-once'
import feathersServiceBehavior from 'can-connect-feathers/service'
const feathersConnection = function (newBehaviors, options) {
if (arguments.length === 1) {
options = newBehaviors
}
const behaviors = [
feathersServiceBehavior,
constructor,
canMap,
canRef,
constructorStore,
dataCallbacks,
combineRequests,
dataParse,
realTime,
callbacksOnce]
if (arguments.length === 2) {
[].push.apply(behaviors, newBehaviors)
}
return connect(behaviors, options)
}
export default feathersConnection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment