Completed
Push — master ( 9ae94f...036dfa )
by Taavo-Taur
01:13
created

example/index.js   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 31
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 0
c 2
b 0
f 0
nc 1
dl 0
loc 31
rs 10
wmc 2
mnd 0
bc 2
fnc 2
bpm 1
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A require.specialFilters.$like 0 6 1
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
// Convenience method to access feathers client in vue instances
28
Vue.prototype.$feathers = client
29
30
// Create instance
31
const app = global.app = new Vue(App)
32
app.$mount('#app')
33