Pusher part one

This commit is contained in:
James Barnsley
2016-10-27 16:58:11 +13:00
parent c4fcf43b3c
commit 6de44cda53
10 changed files with 192 additions and 10 deletions

View File

@ -0,0 +1,23 @@
export default function reducer(pusher = {}, action){
switch (action.type) {
case 'PUSHER_CONNECTED':
return Object.assign({}, pusher, { connected: true, connecting: false });
case 'PUSHER_DISCONNECTED':
return Object.assign({}, pusher, { connected: false, connecting: false });
case 'PUSHER_SET_CONFIG':
return Object.assign({}, pusher, {
host: action.host,
port: action.port
});
default:
return pusher
}
}