Created
November 2, 2016 04:56
-
-
Save adnaan/5a86e84721ab1a3cac42a63792eddd6d to your computer and use it in GitHub Desktop.
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
effects: { * query(_, { call, put }: { call: Function, put: Function }) { | |
const { success, data } = yield call(getProducts); | |
if (success) { | |
yield put({ | |
type: 'querySuccess', | |
products: data, | |
}); | |
} | |
}, | |
* vote({ id }: { id: number }, { call, put }: { call: Function, put: Function }) { | |
const { success } = yield call(updateVote, id); | |
if (success) { | |
yield put({ | |
type: 'voteSuccess', | |
id, | |
}); | |
} | |
}, | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment