daily pastebin goal
86%
SHARE
TWEET

Untitled

a guest Jan 16th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function* flow() {
  2.   while (true) {
  3.     let { payload } = yield take(`${login}`);
  4.     const socket = yield call(connect);
  5.     socket.emit('login', { username: payload.username });
  6.  
  7.     const task = yield fork(handleIO, socket);
  8.  
  9.     let action = yield take(`${logout}`);
  10.     yield cancel(task);
  11.     socket.emit('logout');
  12.   }
  13. }
  14.  
  15. export default function* rootSaga() {
  16.   yield fork(flow);
  17. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top