redux-saga/effects#takeEvery JavaScript Examples

The following examples show how to use redux-saga/effects#takeEvery. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.js    From agenda with MIT License 6 votes vote down vote up
export default function* root() {
    yield all([
        takeEvery(FETCH_ASSIGNMENTS_REQUESTED, fetchAssignments),
        takeEvery(SUBMIT_ASSIGNMENT_DATA_REQUESTED, submitAssignmentData),
        takeEvery(FETCH_ASSIGNMENT_REQUESTED, fetchAssignment),
        takeEvery(FETCH_CONTACTS_REQUESTED, fetchContacts),
        takeEvery(SUBMIT_CONTACT_DATA_REQUESTED, submitContactData),
        takeEvery(FETCH_CONTACT_REQUESTED, fetchContact),
        takeEvery(FETCH_DEPARTMENTS_REQUESTED, fetchDepartments),
        takeEvery(SUBMIT_DEPARTMENT_DATA_REQUESTED, submitDepartmentData),
        takeEvery(FETCH_DEPARTMENT_REQUESTED, fetchDepartment),
        takeEvery(DELETE_ASSIGNMENT_REQUESTED, deleteAssignment)
    ]);
}
Example #2
Source File: appstate.js    From haven with MIT License 6 votes vote down vote up
AppstateSaga = function* Search() {
  yield takeEvery(actions.publishLocalData, publishData);
  // yield takeEvery(actions.localDataPublished, notifyServer);
  yield takeEvery(actions.setKeyword, sendSearchRequest);
  yield takeEvery(actions.setCategory, sendCategoryRequest);
  yield takeEvery(actions.setCategoryKeyword, sendCategoryRequest);
  yield takeEvery(actions.triggerReviewPrompt, triggerRate);
  yield takeEvery(actions.setGuest, setGuest);
  yield takeEvery(actions.initializeLogin, initializeLogin);
  yield takeEvery(actions.updateNotificationSettings, updateNotificationSettings);
  yield takeEvery(actions.migrateFeatureNotificationSettings, migrateFeatureNotificationSettings);
}
Example #3
Source File: sagas.js    From gobench with Apache License 2.0 6 votes vote down vote up
export default function * rootSaga () {
  yield all([
    takeEvery(actions.LIST, LIST),
    takeEvery(actions.DETAIL, DETAIL),
    takeEvery(actions.CREATE, CREATE),
    takeEvery(actions.UPDATE, UPDATE),
    takeEvery(actions.DELETE, DELETE),
    takeEvery(actions.LOG, LOG),
    takeEvery(actions.SYSLOG, SYSLOG),
    takeEvery(actions.TAGS, TAGS),
    takeEvery(actions.TAG_ADD, TAG_ADD),
    takeEvery(actions.TAG_REMOVE, TAG_REMOVE),

    takeEvery(actions.CLONE, CLONE),
    takeEvery(actions.CANCEL, CANCEL),
    takeEvery(actions.GROUPS, GROUPS),
    takeEvery(actions.GRAPHS, GRAPHS),
    takeEvery(actions.GRAPH_METRICS, GRAPH_METRICS),
    // takeEvery(actions.COUNTERS, COUNTERS),
    takeEvery(actions.HISTOGRAMS, HISTOGRAMS),
    takeEvery(actions.GAUGES, GAUGES),
    takeEvery(actions.METRICS, METRICS),
    takeEvery(actions.METRIC_DATA, METRIC_DATA),
    takeEvery(actions.GRAPH_METRIC_DATA, GRAPH_METRIC_DATA),
    takeEvery(actions.METRIC_DATA_POLLING, METRIC_DATA_POLLING)
  ])
}
Example #4
Source File: comments.sagas.js    From horondi_admin with MIT License 6 votes vote down vote up
export default function* commentsSaga() {
  yield takeEvery(GET_COMMENTS, handleCommentsLoad);
  yield takeEvery(GET_COMMENTS_USER, handleCommentsUserLoad);
  yield takeEvery(GET_REPLIES_COMMENTS_USER, handleRepliesCommentsUserLoad);
  yield takeEvery(GET_RECENT_COMMENTS, handleRecentCommentsLoad);
  yield takeEvery(DELETE_COMMENT, handleCommentDelete);
  yield takeEvery(UPDATE_COMMENT, handleCommentUpdate);
  yield takeEvery(GET_COMMENT, handleCommentLoad);
  yield takeEvery(GET_COMMENTS_BY_TYPE, handleCommentsByTypeLoad);
  yield takeEvery(GET_REPLY_COMMENTS, handleGetReplyComments);
  yield takeEvery(DELETE_REPLY_COMMENT, handleReplyCommentDelete);
  yield takeEvery(ADD_REPLY_COMMENT, handleAddReplyComment);
  yield takeEvery(UPDATE_REPLY, handleReplyCommentUpdate);
  yield takeEvery(GET_REPLY, handleReplyCommentLoad);
}
Example #5
Source File: user.sagas.js    From horondi_client_fe with MIT License 6 votes vote down vote up
export default function* userSaga() {
  yield takeEvery(LOGIN_USER, handleUserLogin);
  yield takeEvery(CONFIRM_USER, handleUserConfirm);
  yield takeEvery(RECOVER_USER, handleUserRecovery);
  yield takeEvery(PASSWORD_RESET, handlePasswordReset);
  yield takeEvery(CHECK_IF_TOKEN_VALID, handleTokenCheck);
  yield takeEvery(REGISTER_USER, handleUserRegister);
  yield takeEvery(PRESERVE_USER, handleUserPreserve);
  yield takeEvery(UPDATE_USER, handleUpdateUser);
  yield takeEvery(SEND_CONFIRMATION_EMAIL, handleSendConfirmation);
  yield takeEvery(LOGIN_BY_GOOGLE, handleGoogleUserLogin);
  yield takeEvery(LOGIN_BY_FACEBOOK, handleFacebookUserLogin);
  yield takeEvery(LOGOUT_USER, handleUserLogout);
}
Example #6
Source File: movie-details.sagas.js    From movies with MIT License 6 votes vote down vote up
// watchers
export default function* watchMovieDetails() {
  yield all([
    takeEvery(actionKeys.MOVIE_DETAILS, getDetailsSaga),
    takeEvery(actionKeys.MOVIE_CREDITS, getCreditsSaga),
    takeEvery(actionKeys.MOVIE_VIDEOS, getVideosSaga),
    takeEvery(actionKeys.MOVIE_IMAGES, getImagesSaga),
    takeEvery(actionKeys.MOVIE_RECOMMS, getRecommsSaga),
    takeEvery(actionKeys.MOVIE_RESET_ALL, resetMovieDetailsSaga)
  ]);
}
Example #7
Source File: saga.js    From rysolv with GNU Affero General Public License v3.0 6 votes vote down vote up
export default function* watcherSaga() {
  yield takeEvery(FETCH_QUESTIONS, fetchQuestionsSaga);
  yield takeLatest(CREATE_POSITION, createPositionSaga);
  yield takeLatest(DELETE_POSITION, deletePositionSaga);
  yield takeLatest(EDIT_COMPANY, editCompanySaga);
  yield takeLatest(EDIT_POSITION, editPositionSaga);
  yield takeLatest(FETCH_CANDIDATE_COUNT, fetchCandidateCountSaga);
  yield takeLatest(FETCH_COMPANY_POSITIONS, fetchCompanyPositionsSaga);
  yield takeLatest(FETCH_COMPANY, fetchCompanySaga);
  yield takeLatest(FETCH_POSITION_CANDIDATES, fetchPositionCandidatesSaga);
  yield takeLatest(FETCH_POSITION, fetchPositionSaga);
  yield takeLatest(MATCH_CANDIDATES, matchCandidatesSaga);
  yield takeLatest(NOTIFY_CANDIDATE, notifyCandidateSaga);
  yield takeLatest(SAVE_CANDIDATE, saveCandidateSaga);
}
Example #8
Source File: sagas.js    From fhir-app-starter with MIT License 5 votes vote down vote up
export default function* root() {
  yield all([takeEvery(LOAD_SMART_INFO, loadSmartInfo)]);
}
Example #9
Source File: saga.js    From frontend-course with MIT License 5 votes vote down vote up
export default function* rootSaga () {
  yield takeEvery("MINUS_START", minus);
}
Example #10
Source File: config.js    From haven with MIT License 5 votes vote down vote up
export default function* Chat() {
  yield takeEvery(actions.getConfiguration, getConfiguration);
}
Example #11
Source File: settingsSagas.js    From NextcloudDuplicateFinder with GNU Affero General Public License v3.0 5 votes vote down vote up
function * watchForAction () {
  yield takeEvery(reducerConstants.app.f.ACTION_REQUESTED, changeFilter)
  yield takeEvery(reducerConstants.app.f.ACTION_REQUESTED, changeSetting)
}
Example #12
Source File: reminder.js    From jc-calendar with MIT License 5 votes vote down vote up
export function* watchNewReminder() {
  yield takeEvery(reminderUIActions.NEW_REMINDER, newReminder);
}
Example #13
Source File: saga.js    From gedge-platform with Apache License 2.0 5 votes vote down vote up
export function* watchUserForget() {
    yield takeEvery(FORGET_USER, forgetUser)
}
Example #14
Source File: saga.js    From awsboilerplate with MIT License 5 votes vote down vote up
/**
 * Root saga manages watcher lifecycle
 */
export default function* launchBackgroundTask() {
  yield takeEvery(SAY_HELLO_REQUEST, sayHello);
  yield takeEvery(BACKGROUND_JOB_SUBMIT, submitBackgroundJob);
  yield takeLatest(BACKGROUND_JOB_STATUS_POLL, getBackgroundJobStatus);
}
Example #15
Source File: sagas.js    From gobench with Apache License 2.0 5 votes vote down vote up
export default function * rootSaga () {
  yield all([
    takeEvery(actions.CHANGE_SETTING, CHANGE_SETTING),
    takeEvery(actions.SET_PRIMARY_COLOR, SET_PRIMARY_COLOR),
    takeEvery(actions.SET_THEME, SET_THEME),
    SETUP() // run once on app load to init listeners
  ])
}
Example #16
Source File: auth.sagas.js    From horondi_admin with MIT License 5 votes vote down vote up
export default function* authSaga() {
  yield takeEvery(LOGIN_USER, handleAdminLoad);
  yield takeEvery(CHECK_USER_BY_TOKEN, handleAdminCheckByToken);
  yield takeEvery(LOGOUT_USER, handleAdminLogout);
}
Example #17
Source File: constructor-basic.sagas.js    From horondi_client_fe with MIT License 5 votes vote down vote up
export default function* constructorBasicSaga() {
  yield takeEvery(GET_CONSTRUCTOR_BASIC, handleConstructorBasicLoad);
}
Example #18
Source File: actions.js    From what-front with MIT License 5 votes vote down vote up
export function* watchAddAlert() {
  yield takeEvery(actionTypes.ADD_ALERT, addAlertAsync);
}