Created
May 4, 2018 08:43
-
-
Save martinkadlec0/85d414648299a454ddfc45ee0d788667 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
| const fetchSaga = function* fetchSaga(action) { | |
| // objScanned -> itemScanned as I assume that was a typo? | |
| const itemScanned = yield call(scanProduct, action.payload.id); | |
| const {id, user} = action.payload; | |
| try { | |
| const result = yield cps(AxusLogger.logScan, {id, user}); | |
| // Or like this if logScan needs AxusLogger context: | |
| // const result = yield cps([AxusLogger, 'logScan'], {id, user}); | |
| dispatchScan(result); | |
| const product = { | |
| id: itemScanned.id, | |
| name: itemScanned.itemId.name, | |
| }; | |
| yield put(scanProductCompleted(itemScanned)); | |
| yield put(navigate('Product Details', { product, from: 'home' })); | |
| } catch (err) { | |
| yield put(navigate('Home')); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment