<commit_before>import {put, fork, takeLatest, all} from 'redux-saga/effects'
import * as actions from './actions'
import {externalEvents} from 'tocco-util'

export default function* sagas() {
  yield all([
    fork(takeLatest, actions.ON_DATE_RANGE_CHANGE, onDateRangeChange),
    fork(takeLatest, actions.ON_CALENDAR_REMOVE, onCalendarRemove),
    fork(takeLatest, actions.ON_EVENT_CLICK, onEventClick)
  ])
}

export function* onDateRangeChange({payload}) {
  const {dateRange} = payload
  yield put(externalEvents.fireExternalEvent('onDateRangeChange', {dateRange}))
}

export function* onCalendarRemove({payload}) {
  yield put(externalEvents.fireExternalEvent('onCalendarRemove', {id: payload.id, calendarType: payload.calendarType}))
}

export function* onEventClick({payload}) {
  const {event} = payload
  yield put(externalEvents.fireExternalEvent('onEventClick', event.entity))
}<commit_msg>feat(scheduler): only call onEventClick if source entity is set<commit_after>import {put, fork, takeLatest, all} from 'redux-saga/effects'
import * as actions from './actions'
import {externalEvents} from 'tocco-util'

export default function* sagas() {
  yield all([
    fork(takeLatest, actions.ON_DATE_RANGE_CHANGE, onDateRangeChange),
    fork(takeLatest, actions.ON_CALENDAR_REMOVE, onCalendarRemove),
    fork(takeLatest, actions.ON_EVENT_CLICK, onEventClick)
  ])
}

export function* onDateRangeChange({payload}) {
  const {dateRange} = payload
  yield put(externalEvents.fireExternalEvent('onDateRangeChange', {dateRange}))
}

export function* onCalendarRemove({payload}) {
  yield put(externalEvents.fireExternalEvent('onCalendarRemove', {id: payload.id, calendarType: payload.calendarType}))
}

export function* onEventClick({payload}) {
  const {event: {entity}} = payload
  if (entity) {
    yield put(externalEvents.fireExternalEvent('onEventClick', entity))
  }
}
{'fraction_non_alphanumeric': 0.12087326943556975, 'fraction_numerical': 0.0, 'mean_word_length': 6.669387755102041, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5994112', 'n_tokens_mistral': 572, 'n_tokens_neox': 570, 'n_words': 127}