Files
freeCodeCamp/client/src/redux/ga-saga.js
Ahmad Abdolsaheb 24eb2c4310 fix: add donation ga and tests (#38003)
* fix: add donation ga

* feat: add ga-saga tests
2020-02-04 11:13:56 +05:30

13 lines
355 B
JavaScript

import { takeEvery, call, all } from 'redux-saga/effects';
import ga from '../analytics';
const GaTypes = { event: ga.event, page: ga.pageview, modal: ga.modalview };
function* callGaType({ payload: { type, data } }) {
yield call(GaTypes[type], data);
}
export function* createGaSaga(types) {
yield all([takeEvery(types.executeGA, callGaType)]);
}