<commit_before>// import R from 'ramda'
import { useEffect } from 'react'

import { ERR } from '@constant'
import { buildLog, $solver, asyncErr, errRescue } from '@utils'

import SR71 from '@utils/async/sr71'
// import S from './schema'

const sr71$ = new SR71()
let sub$ = null
let store = null

/* eslint-disable-next-line */
const log = buildLog('L:HaveADrinkContent')

// local namespace
export const LN = {
  // class name of the animate timer components
  ANIMATE_TIMER_CLASS: 'animate-timer',
  VIEW: {
    DEFAULT: 'default',
    CATALOG: 'catalog',
    SETTING: 'setting',
    ABOUT: 'about',
    EDIT: 'edit',
    SHARE: 'share',
    COMMENT: 'comment',
  },
}

/**
 * change the main view type
 *
 * @param {string} view, view type
 */
export const setView = view => store.mark({ view })

/**
 * change the setting
 *
 * @param {key} optionObj, setting key
 * @param {val} string, setting value
 */
export const setSetting = (key, val) => {
  store.mark({ [key]: val })<commit_msg>fix(HaveADrink): stop timer when switch view<commit_after>// import R from 'ramda'
import { useEffect } from 'react'

import { ERR } from '@constant'
import { buildLog, $solver, asyncErr, errRescue } from '@utils'

import SR71 from '@utils/async/sr71'
// import S from './schema'

const sr71$ = new SR71()
let sub$ = null
let store = null

/* eslint-disable-next-line */
const log = buildLog('L:HaveADrinkContent')

// local namespace
export const LN = {
  // class name of the animate timer components
  ANIMATE_TIMER_CLASS: 'animate-timer',
  VIEW: {
    DEFAULT: 'default',
    CATALOG: 'catalog',
    SETTING: 'setting',
    ABOUT: 'about',
    EDIT: 'edit',
    SHARE: 'share',
    COMMENT: 'comment',
  },
}

/**
 * change the main view type, and stop timer
 *
 * @param {string} view, view type
 */
export const setView = view => {
  store.mark({ view })
  stopTimer()
}

/**
 * change the setting
 *
 * @param {key} optionObj, setting key
 * @param {val} string, setting value
 */
export const setSetting = (key, val) => {
  store.mark({ [key]: val })
{'fraction_non_alphanumeric': 0.15212091662603608, 'fraction_numerical': 0.0078010726474890294, 'mean_word_length': 3.4415584415584415, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4773088', 'n_tokens_mistral': 706, 'n_tokens_neox': 681, 'n_words': 225}