remove messages reducer

This commit is contained in:
Jonathan Rainville 2018-08-08 15:10:30 -04:00 committed by Pascal Precht
parent 2ca039cd1b
commit 289ed2bda8
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 0 additions and 36 deletions

View File

@ -1,36 +0,0 @@
import * as actions from "../actions";
export default function messages(state = {channels: {}}, action) {
switch (action.type) {
case actions.MESSAGE_LISTEN[actions.SUCCESS]: {
const messages = state.channels[action.channel] ? state.channels[action.channel].messages : [];
messages.push(action.message.data);
return {
...state,
channels: {
...state.channels,
[action.channel]: {
...state.channels[action.channel],
messages: messages
}
}
};
}
case actions.MESSAGE_LISTEN[actions.REQUEST]: {
const subscriptions = state.subscriptions || [];
subscriptions.push(action.channel);
return {
...state,
subscriptions: subscriptions
};
}
case actions.MESSAGE_VERSION[actions.SUCCESS]: {
return {
...state,
version: action.version.data
};
}
default:
return state;
}
}