mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
Replaced startsWith with lodash functionality
Now its working for older browsers as well related to #50
This commit is contained in:
parent
d44a480584
commit
20c9fb0d67
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
import Emitter from './Emitter'
|
import Emitter from './Emitter'
|
||||||
import Socket from 'socket.io-client'
|
import Socket from 'socket.io-client'
|
||||||
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
export default class{
|
export default class{
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ export default class{
|
||||||
|
|
||||||
|
|
||||||
passToStore(event, payload){
|
passToStore(event, payload){
|
||||||
if(!event.startsWith('SOCKET_')) return
|
if(!_.startsWith(event,'SOCKET_')) return
|
||||||
|
|
||||||
for(let namespaced in this.store._mutations) {
|
for(let namespaced in this.store._mutations) {
|
||||||
let mutation = namespaced.split('/').pop()
|
let mutation = namespaced.split('/').pop()
|
||||||
|
@ -47,7 +48,7 @@ export default class{
|
||||||
for(let namespaced in this.store._actions) {
|
for(let namespaced in this.store._actions) {
|
||||||
let action = namespaced.split('/').pop()
|
let action = namespaced.split('/').pop()
|
||||||
|
|
||||||
if(!action.startsWith('socket_')) continue
|
if(!_.startsWith(action,'socket_')) continue
|
||||||
|
|
||||||
let camelcased = 'socket_'+event
|
let camelcased = 'socket_'+event
|
||||||
.replace('SOCKET_', '')
|
.replace('SOCKET_', '')
|
||||||
|
|
Loading…
Add table
Reference in a new issue