actionTypes
const randomString = () =>
Math.random().toString(36).substring(7).split('').join('.')
const ActionTypes = {
INIT: `@@redux/INIT${/* #__PURE__ */ randomString()}`,
REPLACE: `@@redux/REPLACE${/* #__PURE__ */ randomString()}`,
PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`
}
export default ActionTypes
symbol-observable
// SymbolConstructor与Symbol并没有关系
declare global {
interface SymbolConstructor {
readonly observable: symbol
}
}
// 假设如果存在 判断是否支持Symbol语法 不支持就取 (() => '@@observable')() = '@@observable'
// Symbol的唯一降级到约定@@observable作为唯一
const $$observable = /* #__PURE__ */ (() =>
(typeof Symbol === 'function' && Symbol.observable) || '@@observable')()
export default $$observable