vn-verdnaturachat/app/sagas/selectServer.js

16 lines
478 B
JavaScript
Raw Normal View History

import { put, takeEvery } from 'redux-saga/effects';
import { SERVER } from '../actions/actionsTypes';
import { connectRequest, disconnect } from '../actions/connect';
import { changedServer } from '../actions/server';
const selectServer = function* selectServer(server) {
2017-08-21 00:11:46 +00:00
yield put(disconnect());
yield put(changedServer(server));
yield put(connectRequest(server));
};
const root = function* root() {
yield takeEvery(SERVER.SELECT, selectServer);
};
export default root;