<commit_before>import produce from "immer";
import {
  EXECUTION_BREAKPOINT_TOGGLE,
  EXECUTION_CONNECT,
  EXECUTION_DELAY,
  EXECUTION_FAILED,
  EXECUTION_FULFILLED,
  EXECUTION_LOAD,
  EXECUTION_PAUSE,
  EXECUTION_RUN,
  EXECUTION_STEP,
  EXECUTION_STOP
} from "../actionTypes";

const initialState = {
  running: false,
  paused: false,
  delay: 0,
  stopConditionFulfillment: 0,
  totalCount: 0,
  visited: {},
  breakpoints: {}
}

export default function(state = initialState, action) {
  switch (action.type) {
    case EXECUTION_BREAKPOINT_TOGGLE: {
      const { modelId, elementId } = action.payload;
      const key = `${modelId},${elementId}`;
      return produce(state , draft => {
        if (key in draft.breakpoints) {
          delete draft.breakpoints[key];
        } else {
          draft.breakpoints[key] = true;
        }
      });
    }
    case EXECUTION_CONNECT: {<commit_msg>Set a default delay<commit_after>import produce from "immer";
import {
  EXECUTION_BREAKPOINT_TOGGLE,
  EXECUTION_CONNECT,
  EXECUTION_DELAY,
  EXECUTION_FAILED,
  EXECUTION_FULFILLED,
  EXECUTION_LOAD,
  EXECUTION_PAUSE,
  EXECUTION_RUN,
  EXECUTION_STEP,
  EXECUTION_STOP
} from "../actionTypes";

const initialState = {
  running: false,
  paused: false,
  delay: 250,
  stopConditionFulfillment: 0,
  totalCount: 0,
  visited: {},
  breakpoints: {}
}

export default function(state = initialState, action) {
  switch (action.type) {
    case EXECUTION_BREAKPOINT_TOGGLE: {
      const { modelId, elementId } = action.payload;
      const key = `${modelId},${elementId}`;
      return produce(state , draft => {
        if (key in draft.breakpoints) {
          delete draft.breakpoints[key];
        } else {
          draft.breakpoints[key] = true;
        }
      });
    }
    case EXECUTION_CONNECT: {
{'fraction_non_alphanumeric': 0.10828729281767956, 'fraction_numerical': 0.004419889502762431, 'mean_word_length': 3.2313084112149535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5933747', 'n_tokens_mistral': 654, 'n_tokens_neox': 613, 'n_words': 125}