eslint stuff
This commit is contained in:
parent
5471c2a350
commit
1d801f036f
11 changed files with 23 additions and 29 deletions
|
@ -1,4 +1,5 @@
|
|||
/* globals $ */
|
||||
/* global $ */
|
||||
|
||||
/*
|
||||
everthing in this file happens as a result of websocket events
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
import React from 'react'
|
||||
import ReactDOM from 'react-dom' // TODO ensure this isn't a double import
|
||||
|
||||
import { JUNTO_UPDATED } from '../Realtime/events'
|
||||
import Active from '../Active'
|
||||
import Realtime from '../Realtime'
|
||||
import Maps from '../../components/Maps'
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* global $ */
|
||||
|
||||
import ExploreMaps from './ExploreMaps'
|
||||
import ChatView from './ChatView'
|
||||
import VideoView from './VideoView'
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
import {
|
||||
const {
|
||||
// server sendable, client receivable
|
||||
TOPIC_UPDATED,
|
||||
TOPIC_DELETED,
|
||||
|
@ -18,11 +17,9 @@ import {
|
|||
UPDATE_SYNAPSE,
|
||||
DELETE_SYNAPSE,
|
||||
UPDATE_MAP
|
||||
} from '../frontend/src/Metamaps/Realtime/events'
|
||||
|
||||
} = require('../frontend/src/Metamaps/Realtime/events')
|
||||
|
||||
module.exports = function (io, store) {
|
||||
|
||||
store.subscribe(() => {
|
||||
console.log(store.getState())
|
||||
io.sockets.emit(JUNTO_UPDATED, store.getState())
|
||||
|
@ -32,7 +29,7 @@ module.exports = function (io, store) {
|
|||
|
||||
io.sockets.emit(JUNTO_UPDATED, store.getState())
|
||||
|
||||
socket.on(JOIN_MAP, data => store.dispatch({ type: JOIN_MAP, payload: data}))
|
||||
socket.on(JOIN_MAP, data => store.dispatch({ type: JOIN_MAP, payload: data }))
|
||||
socket.on(LEAVE_MAP, () => store.dispatch({ type: LEAVE_MAP, payload: socket }))
|
||||
socket.on(JOIN_CALL, data => store.dispatch({ type: JOIN_CALL, payload: data }))
|
||||
socket.on(LEAVE_CALL, () => store.dispatch({ type: LEAVE_CALL, payload: socket }))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {
|
||||
const {
|
||||
INVITED_TO_CALL,
|
||||
INVITED_TO_JOIN,
|
||||
CALL_ACCEPTED,
|
||||
|
@ -17,7 +17,7 @@ import {
|
|||
INVITE_A_CALL,
|
||||
JOIN_CALL,
|
||||
LEAVE_CALL
|
||||
} from '../frontend/src/Metamaps/Realtime/events'
|
||||
} = require('../frontend/src/Metamaps/Realtime/events')
|
||||
|
||||
const { mapRoom, userMapRoom } = require('./rooms')
|
||||
|
||||
|
@ -65,4 +65,3 @@ module.exports = function (io, store) {
|
|||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
import {
|
||||
const {
|
||||
MAPPER_LIST_UPDATED,
|
||||
NEW_MAPPER,
|
||||
LOST_MAPPER,
|
||||
|
@ -21,7 +20,7 @@ import {
|
|||
REMOVE_TOPIC,
|
||||
CREATE_SYNAPSE,
|
||||
REMOVE_SYNAPSE
|
||||
} from '../frontend/src/Metamaps/Realtime/events'
|
||||
} = require('../frontend/src/Metamaps/Realtime/events')
|
||||
|
||||
const { mapRoom, userMapRoom } = require('./rooms')
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ map = require('./map'),
|
|||
global = require('./global'),
|
||||
stunservers = [{"url": "stun:stun.l.google.com:19302"}]
|
||||
|
||||
import { createStore } from 'redux'
|
||||
import { reducer } from './reducer'
|
||||
const { createStore } = require('redux')
|
||||
const { reducer } = require('./reducer')
|
||||
|
||||
let store = createStore(reducer)
|
||||
|
||||
|
@ -15,5 +15,5 @@ global(io, store)
|
|||
signalling(io, stunservers, store)
|
||||
junto(io, store)
|
||||
map(io, store)
|
||||
io.listen(5001)
|
||||
|
||||
io.listen(5001)
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
|
||||
import { omit, omitBy, isNil, mapValues } from 'lodash'
|
||||
import {
|
||||
const { omit, omitBy, isNil, mapValues } = require('lodash')
|
||||
const {
|
||||
JOIN_MAP,
|
||||
LEAVE_MAP,
|
||||
JOIN_CALL,
|
||||
LEAVE_CALL
|
||||
} from '../frontend/src/Metamaps/Realtime/events'
|
||||
} = require('../frontend/src/Metamaps/Realtime/events')
|
||||
|
||||
const NOT_IN_CONVERSATION = 0
|
||||
const IN_CONVERSATION = 1
|
||||
|
||||
const addMapperToMap = (map, userId) => { return { ...map, [userId]: NOT_IN_CONVERSATION }}
|
||||
|
||||
export const reducer = (state = { connectedPeople: {}, liveMaps: {} }, action) => {
|
||||
module.exports = { reducer: (state = { connectedPeople: {}, liveMaps: {} }, action) => {
|
||||
const { type, payload } = action
|
||||
const { connectedPeople, liveMaps } = state
|
||||
const map = payload && liveMaps[payload.mapid]
|
||||
|
@ -85,4 +84,4 @@ export const reducer = (state = { connectedPeople: {}, liveMaps: {} }, action) =
|
|||
default:
|
||||
return state
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
module.exports = {
|
||||
mapRoom: mapId => `maps/${mapId}`,
|
||||
userMapRoom: (mapperId, mapId) => `mappers/${mapperId}/maps/${mapId}`,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var uuid = require('node-uuid')
|
||||
const uuid = require('node-uuid')
|
||||
|
||||
// based off of https://github.com/andyet/signalmaster
|
||||
// since it was updated to socket.io 1.3.7
|
||||
|
@ -12,7 +12,6 @@ function safeCb(cb) {
|
|||
}
|
||||
|
||||
module.exports = function(io, stunservers, state) {
|
||||
|
||||
io.on('connection', function (socket) {
|
||||
socket.resources = {
|
||||
screen: false,
|
||||
|
|
Loading…
Add table
Reference in a new issue