Total Complexity | 2 |
Complexity/F | 1 |
Lines of Code | 29 |
Function Count | 2 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | // Feathers client |
||
2 | import feathers from 'feathers/client' |
||
3 | import feathersIO from 'feathers-socketio/client' |
||
4 | import io from 'socket.io-client' |
||
5 | import Vue from 'vue' |
||
6 | import VueSyncersFeathers from '../src' |
||
7 | |||
8 | import App from './app.vue' |
||
9 | |||
10 | const socket = io() |
||
11 | const client = feathers() |
||
12 | client.configure(feathersIO(socket)) |
||
13 | |||
14 | // Patch in {$like: 'var'} ability to special filters |
||
15 | require('feathers-commons/lib/utils').specialFilters.$like = function (key, value) { |
||
16 | value = value.toString().toLowerCase() |
||
17 | return function (current) { |
||
18 | return current[key].toString().toLowerCase().indexOf(value) !== -1 |
||
19 | } |
||
20 | } |
||
21 | |||
22 | // Install vue-syncers-feathers |
||
23 | Vue.use(VueSyncersFeathers, { |
||
24 | feathers: client |
||
25 | }) |
||
26 | |||
27 | // Create instance |
||
28 | const app = new Vue(App) |
||
29 | global.app = app |
||
30 | app.$mount('#app') |
||
31 |