Auto eslint fix
This commit is contained in:
@ -1,249 +1,249 @@
|
||||
|
||||
export function setPort(port){
|
||||
return {
|
||||
type: 'PUSHER_SET_PORT',
|
||||
port: port
|
||||
}
|
||||
export function setPort(port) {
|
||||
return {
|
||||
type: 'PUSHER_SET_PORT',
|
||||
port,
|
||||
};
|
||||
}
|
||||
|
||||
export function setUsername(username, force = false){
|
||||
return {
|
||||
type: 'PUSHER_SET_USERNAME',
|
||||
username: username.replace(/[\W_]+/g,''),
|
||||
force: force
|
||||
}
|
||||
export function setUsername(username, force = false) {
|
||||
return {
|
||||
type: 'PUSHER_SET_USERNAME',
|
||||
username: username.replace(/[\W_]+/g, ''),
|
||||
force,
|
||||
};
|
||||
}
|
||||
|
||||
export function connect(){
|
||||
return {
|
||||
type: 'PUSHER_CONNECT'
|
||||
}
|
||||
export function connect() {
|
||||
return {
|
||||
type: 'PUSHER_CONNECT',
|
||||
};
|
||||
}
|
||||
|
||||
export function disconnect(){
|
||||
return {
|
||||
type: 'PUSHER_DISCONNECT'
|
||||
}
|
||||
export function disconnect() {
|
||||
return {
|
||||
type: 'PUSHER_DISCONNECT',
|
||||
};
|
||||
}
|
||||
|
||||
export function upgrade(){
|
||||
return {
|
||||
type: 'PUSHER_UPGRADE'
|
||||
}
|
||||
export function upgrade() {
|
||||
return {
|
||||
type: 'PUSHER_UPGRADE',
|
||||
};
|
||||
}
|
||||
|
||||
export function reload(){
|
||||
return {
|
||||
type: 'PUSHER_RELOAD'
|
||||
}
|
||||
export function reload() {
|
||||
return {
|
||||
type: 'PUSHER_RELOAD',
|
||||
};
|
||||
}
|
||||
|
||||
export function restart(){
|
||||
return {
|
||||
type: 'PUSHER_RESTART'
|
||||
}
|
||||
export function restart() {
|
||||
return {
|
||||
type: 'PUSHER_RESTART',
|
||||
};
|
||||
}
|
||||
|
||||
export function localScan(){
|
||||
return {
|
||||
type: 'PUSHER_LOCAL_SCAN'
|
||||
}
|
||||
export function localScan() {
|
||||
return {
|
||||
type: 'PUSHER_LOCAL_SCAN',
|
||||
};
|
||||
}
|
||||
|
||||
export function getConnections(){
|
||||
return {
|
||||
type: 'PUSHER_GET_CONNECTIONS'
|
||||
}
|
||||
export function getConnections() {
|
||||
return {
|
||||
type: 'PUSHER_GET_CONNECTIONS',
|
||||
};
|
||||
}
|
||||
|
||||
export function connectionAdded(connection){
|
||||
return {
|
||||
type: 'PUSHER_CONNECTION_ADDED',
|
||||
connection: connection
|
||||
}
|
||||
export function connectionAdded(connection) {
|
||||
return {
|
||||
type: 'PUSHER_CONNECTION_ADDED',
|
||||
connection,
|
||||
};
|
||||
}
|
||||
|
||||
export function updateConnection(connection){
|
||||
return {
|
||||
type: 'PUSHER_UPDATE_CONNECTION',
|
||||
connection: connection
|
||||
}
|
||||
export function updateConnection(connection) {
|
||||
return {
|
||||
type: 'PUSHER_UPDATE_CONNECTION',
|
||||
connection,
|
||||
};
|
||||
}
|
||||
|
||||
export function connectionChanged(connection){
|
||||
return {
|
||||
type: 'PUSHER_CONNECTION_CHANGED',
|
||||
connection: connection
|
||||
}
|
||||
export function connectionChanged(connection) {
|
||||
return {
|
||||
type: 'PUSHER_CONNECTION_CHANGED',
|
||||
connection,
|
||||
};
|
||||
}
|
||||
|
||||
export function connectionRemoved(connection){
|
||||
return {
|
||||
type: 'PUSHER_CONNECTION_REMOVED',
|
||||
connection: connection
|
||||
}
|
||||
export function connectionRemoved(connection) {
|
||||
return {
|
||||
type: 'PUSHER_CONNECTION_REMOVED',
|
||||
connection,
|
||||
};
|
||||
}
|
||||
|
||||
export function request(method, params = null, response_callback = null, error_callback = null){
|
||||
return {
|
||||
type: 'PUSHER_REQUEST',
|
||||
method: method,
|
||||
params: params,
|
||||
response_callback: response_callback,
|
||||
error_callback: error_callback
|
||||
}
|
||||
export function request(method, params = null, response_callback = null, error_callback = null) {
|
||||
return {
|
||||
type: 'PUSHER_REQUEST',
|
||||
method,
|
||||
params,
|
||||
response_callback,
|
||||
error_callback,
|
||||
};
|
||||
}
|
||||
|
||||
export function getConfig(){
|
||||
return {
|
||||
type: 'PUSHER_GET_CONFIG'
|
||||
}
|
||||
export function getConfig() {
|
||||
return {
|
||||
type: 'PUSHER_GET_CONFIG',
|
||||
};
|
||||
}
|
||||
|
||||
export function getVersion(){
|
||||
return {
|
||||
type: 'PUSHER_GET_VERSION'
|
||||
}
|
||||
export function getVersion() {
|
||||
return {
|
||||
type: 'PUSHER_GET_VERSION',
|
||||
};
|
||||
}
|
||||
|
||||
export function deliverBroadcast(method, params){
|
||||
return {
|
||||
type: 'PUSHER_DELIVER_BROADCAST',
|
||||
data: {
|
||||
method: method,
|
||||
params: params
|
||||
}
|
||||
}
|
||||
export function deliverBroadcast(method, params) {
|
||||
return {
|
||||
type: 'PUSHER_DELIVER_BROADCAST',
|
||||
data: {
|
||||
method,
|
||||
params,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function deliverMessage(recipient, method, params){
|
||||
return {
|
||||
type: 'PUSHER_DELIVER_MESSAGE',
|
||||
data: {
|
||||
recipient: recipient,
|
||||
method: method,
|
||||
params: params
|
||||
}
|
||||
}
|
||||
export function deliverMessage(recipient, method, params) {
|
||||
return {
|
||||
type: 'PUSHER_DELIVER_MESSAGE',
|
||||
data: {
|
||||
recipient,
|
||||
method,
|
||||
params,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function getRadio(){
|
||||
return {
|
||||
type: 'PUSHER_GET_RADIO'
|
||||
}
|
||||
export function getRadio() {
|
||||
return {
|
||||
type: 'PUSHER_GET_RADIO',
|
||||
};
|
||||
}
|
||||
|
||||
export function startRadio(uris){
|
||||
return {
|
||||
type: 'PUSHER_START_RADIO',
|
||||
uris: uris
|
||||
}
|
||||
export function startRadio(uris) {
|
||||
return {
|
||||
type: 'PUSHER_START_RADIO',
|
||||
uris,
|
||||
};
|
||||
}
|
||||
|
||||
export function updateRadio(uris){
|
||||
return {
|
||||
type: 'PUSHER_UPDATE_RADIO',
|
||||
uris: uris
|
||||
}
|
||||
export function updateRadio(uris) {
|
||||
return {
|
||||
type: 'PUSHER_UPDATE_RADIO',
|
||||
uris,
|
||||
};
|
||||
}
|
||||
|
||||
export function stopRadio(){
|
||||
return {
|
||||
type: 'PUSHER_STOP_RADIO'
|
||||
}
|
||||
export function stopRadio() {
|
||||
return {
|
||||
type: 'PUSHER_STOP_RADIO',
|
||||
};
|
||||
}
|
||||
|
||||
export function radioStarted(radio){
|
||||
return {
|
||||
type: 'PUSHER_RADIO_STARTED',
|
||||
radio: radio
|
||||
}
|
||||
export function radioStarted(radio) {
|
||||
return {
|
||||
type: 'PUSHER_RADIO_STARTED',
|
||||
radio,
|
||||
};
|
||||
}
|
||||
|
||||
export function radioChanged(radio){
|
||||
return {
|
||||
type: 'PUSHER_RADIO_CHANGED',
|
||||
radio: radio
|
||||
}
|
||||
export function radioChanged(radio) {
|
||||
return {
|
||||
type: 'PUSHER_RADIO_CHANGED',
|
||||
radio,
|
||||
};
|
||||
}
|
||||
|
||||
export function radioStopped(){
|
||||
return {
|
||||
type: 'PUSHER_RADIO_STOPPED'
|
||||
}
|
||||
export function radioStopped() {
|
||||
return {
|
||||
type: 'PUSHER_RADIO_STOPPED',
|
||||
};
|
||||
}
|
||||
|
||||
export function debug(message = null){
|
||||
return {
|
||||
type: 'PUSHER_DEBUG',
|
||||
message: message
|
||||
}
|
||||
export function debug(message = null) {
|
||||
return {
|
||||
type: 'PUSHER_DEBUG',
|
||||
message,
|
||||
};
|
||||
}
|
||||
|
||||
export function getQueueMetadata(){
|
||||
return {
|
||||
type: 'PUSHER_GET_QUEUE_METADATA'
|
||||
}
|
||||
export function getQueueMetadata() {
|
||||
return {
|
||||
type: 'PUSHER_GET_QUEUE_METADATA',
|
||||
};
|
||||
}
|
||||
|
||||
export function queueMetadataChanged(queue_metadata){
|
||||
return {
|
||||
type: 'PUSHER_QUEUE_METADATA_CHANGED',
|
||||
queue_metadata: queue_metadata
|
||||
}
|
||||
export function queueMetadataChanged(queue_metadata) {
|
||||
return {
|
||||
type: 'PUSHER_QUEUE_METADATA_CHANGED',
|
||||
queue_metadata,
|
||||
};
|
||||
}
|
||||
|
||||
export function addQueueMetadata(tlids = [], from_uri = null){
|
||||
return {
|
||||
type: 'PUSHER_ADD_QUEUE_METADATA',
|
||||
tlids: tlids,
|
||||
from_uri: from_uri
|
||||
}
|
||||
export function addQueueMetadata(tlids = [], from_uri = null) {
|
||||
return {
|
||||
type: 'PUSHER_ADD_QUEUE_METADATA',
|
||||
tlids,
|
||||
from_uri,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Commands (buttons)
|
||||
**/
|
||||
* */
|
||||
|
||||
export function getCommands(){
|
||||
return {
|
||||
type: 'PUSHER_GET_COMMANDS'
|
||||
}
|
||||
export function getCommands() {
|
||||
return {
|
||||
type: 'PUSHER_GET_COMMANDS',
|
||||
};
|
||||
}
|
||||
|
||||
export function setCommand(command){
|
||||
return {
|
||||
type: 'PUSHER_SET_COMMAND',
|
||||
command: command
|
||||
}
|
||||
export function setCommand(command) {
|
||||
return {
|
||||
type: 'PUSHER_SET_COMMAND',
|
||||
command,
|
||||
};
|
||||
}
|
||||
|
||||
export function setCommands(commands){
|
||||
return {
|
||||
type: 'PUSHER_SET_COMMANDS',
|
||||
commands: commands
|
||||
}
|
||||
export function setCommands(commands) {
|
||||
return {
|
||||
type: 'PUSHER_SET_COMMANDS',
|
||||
commands,
|
||||
};
|
||||
}
|
||||
|
||||
export function removeCommand(id){
|
||||
return {
|
||||
type: 'PUSHER_REMOVE_COMMAND',
|
||||
id: id
|
||||
}
|
||||
export function removeCommand(id) {
|
||||
return {
|
||||
type: 'PUSHER_REMOVE_COMMAND',
|
||||
id,
|
||||
};
|
||||
}
|
||||
|
||||
export function runCommand(id, notify = false){
|
||||
return {
|
||||
type: 'PUSHER_RUN_COMMAND',
|
||||
id: id,
|
||||
notify: notify
|
||||
}
|
||||
export function runCommand(id, notify = false) {
|
||||
return {
|
||||
type: 'PUSHER_RUN_COMMAND',
|
||||
id,
|
||||
notify,
|
||||
};
|
||||
}
|
||||
|
||||
export function commandsUpdated(commands){
|
||||
return {
|
||||
type: 'PUSHER_COMMANDS_UPDATED',
|
||||
commands: commands
|
||||
}
|
||||
}
|
||||
export function commandsUpdated(commands) {
|
||||
return {
|
||||
type: 'PUSHER_COMMANDS_UPDATED',
|
||||
commands,
|
||||
};
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,73 +1,72 @@
|
||||
|
||||
export default function reducer(pusher = {}, action){
|
||||
switch (action.type){
|
||||
export default function reducer(pusher = {}, action) {
|
||||
switch (action.type) {
|
||||
case 'PUSHER_CONNECT':
|
||||
case 'PUSHER_CONNECTING':
|
||||
return { ...pusher, connected: false, connecting: true };
|
||||
|
||||
case 'PUSHER_CONNECT':
|
||||
case 'PUSHER_CONNECTING':
|
||||
return Object.assign({}, pusher, { connected: false, connecting: true });
|
||||
case 'PUSHER_CONNECTED':
|
||||
return {
|
||||
...pusher,
|
||||
connected: true,
|
||||
connecting: false,
|
||||
connection_id: action.connection_id,
|
||||
client_id: action.client_id,
|
||||
username: action.username,
|
||||
};
|
||||
|
||||
case 'PUSHER_CONNECTED':
|
||||
return Object.assign({}, pusher, {
|
||||
connected: true,
|
||||
connecting: false,
|
||||
connection_id: action.connection_id,
|
||||
client_id: action.client_id,
|
||||
username: action.username
|
||||
});
|
||||
case 'PUSHER_DISCONNECTED':
|
||||
return { ...pusher, connected: false, connecting: false };
|
||||
|
||||
case 'PUSHER_DISCONNECTED':
|
||||
return Object.assign({}, pusher, { connected: false, connecting: false });
|
||||
case 'PUSHER_SET_PORT':
|
||||
return { ...pusher, port: action.port };
|
||||
|
||||
case 'PUSHER_SET_PORT':
|
||||
return Object.assign({}, pusher, { port: action.port });
|
||||
case 'PUSHER_SET_USERNAME':
|
||||
return { ...pusher, username: action.username };
|
||||
|
||||
case 'PUSHER_SET_USERNAME':
|
||||
return Object.assign({}, pusher, { username: action.username });
|
||||
case 'PUSHER_CONNECTIONS':
|
||||
var connections = {};
|
||||
for (let i = 0; i < action.connections.length; i++) {
|
||||
connections[action.connections[i].connection_id] = action.connections[i];
|
||||
}
|
||||
return { ...pusher, connections };
|
||||
|
||||
case 'PUSHER_CONNECTIONS':
|
||||
var connections = {}
|
||||
for (var i = 0; i < action.connections.length; i++){
|
||||
connections[action.connections[i].connection_id] = action.connections[i]
|
||||
}
|
||||
return Object.assign({}, pusher, { connections: connections });
|
||||
case 'PUSHER_CONNECTION_ADDED':
|
||||
case 'PUSHER_CONNECTION_CHANGED':
|
||||
var connections = { ...pusher.connections };
|
||||
connections[action.connection.connection_id] = action.connection;
|
||||
return { ...pusher, connections };
|
||||
|
||||
case 'PUSHER_CONNECTION_ADDED':
|
||||
case 'PUSHER_CONNECTION_CHANGED':
|
||||
var connections = Object.assign({}, pusher.connections)
|
||||
connections[action.connection.connection_id] = action.connection;
|
||||
return Object.assign({}, pusher, { connections: connections });
|
||||
case 'PUSHER_CONNECTION_UPDATED':
|
||||
return {
|
||||
...pusher,
|
||||
username: action.connection.username,
|
||||
client_id: action.connection.client_id,
|
||||
connection_id: action.connection.connection_id,
|
||||
};
|
||||
|
||||
case 'PUSHER_CONNECTION_UPDATED':
|
||||
return Object.assign({}, pusher, {
|
||||
username: action.connection.username,
|
||||
client_id: action.connection.client_id,
|
||||
connection_id: action.connection.connection_id
|
||||
});
|
||||
case 'PUSHER_CONNECTION_REMOVED':
|
||||
var connections = { ...pusher.connections };
|
||||
delete connections[action.connection.connection_id];
|
||||
return { ...pusher, connections };
|
||||
|
||||
case 'PUSHER_CONNECTION_REMOVED':
|
||||
var connections = Object.assign({}, pusher.connections)
|
||||
delete connections[action.connection.connection_id]
|
||||
return Object.assign({}, pusher, { connections: connections });
|
||||
case 'PUSHER_VERSION':
|
||||
return {
|
||||
...pusher,
|
||||
version: action.version,
|
||||
upgrading: false,
|
||||
};
|
||||
|
||||
case 'PUSHER_VERSION':
|
||||
return Object.assign({}, pusher, {
|
||||
version: action.version,
|
||||
upgrading: false
|
||||
});
|
||||
case 'PUSHER_START_UPGRADE':
|
||||
return { ...pusher, upgrading: true };
|
||||
|
||||
case 'PUSHER_START_UPGRADE':
|
||||
return Object.assign({}, pusher, { upgrading: true });
|
||||
case 'PUSHER_CONFIG':
|
||||
return { ...pusher, config: action.config };
|
||||
|
||||
case 'PUSHER_CONFIG':
|
||||
return Object.assign({}, pusher, { config: action.config });
|
||||
case 'PUSHER_COMMANDS_UPDATED':
|
||||
return { ...pusher, commands: action.commands };
|
||||
|
||||
case 'PUSHER_COMMANDS_UPDATED':
|
||||
return Object.assign({}, pusher, { commands: action.commands });
|
||||
|
||||
default:
|
||||
return pusher
|
||||
}
|
||||
default:
|
||||
return pusher;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user