Created
May 12, 2017 09:11
-
-
Save dzNavitski/cb14507ac0e8247d6909b5638f94cbe4 to your computer and use it in GitHub Desktop.
Cancel epic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const editEpic = (action$, store) => action$ | |
.ofType(t.EDIT_UPDATE) | |
.debounceTime(100) | |
.mergeMap((action) => { | |
const { path } = action.meta; | |
return validate$() | |
.delay(3000) | |
.map(() => modelActions.modelSetPendingValidation({ value: false, path: path })) | |
.takeUntil( | |
action$.ofType(t.EDIT_UPDATE, modelActionTypes.MODEL_REMOVE_VALUE) | |
.filter(newAction => path === newAction.meta.path) | |
) | |
.startWith(modelActions.modelSetPendingValidation({ value: true, path: path })); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment