annoy.js 386 B

123456789101112131415161718
  1. import { take, call, put } from 'redux-saga/effects';
  2. import { apiRequest } from 'sagas/api';
  3. import { ANNOYED } from 'constants/actions';
  4. import { annoyResponded } from 'actions/annoy';
  5. export function *annoySaga() {
  6. while (true) {
  7. yield take(ANNOYED);
  8. const { err } = yield call(apiRequest, 'post', 'annoy');
  9. yield put(annoyResponded(err));
  10. }
  11. }