UNPKG

1.5 kBJavaScriptView Raw
1/* global
2 __KOOT_STORE__:false,
3 __KOOT_HISTORY__:false,
4 __KOOT_LOCALEID__:false,
5*/
6
7/**
8 * 手动创建 Redux Store 时需要的相关对象
9 * @type {Object}
10 */
11import * as reduxForCreateStore from './React/redux'
12export { reduxForCreateStore }
13
14/**
15 * 通用的高阶组件/方法的装饰器
16 * @type {Function}
17 */
18export { default as extend } from "__KOOT_HOC_EXTEND__"
19
20// 其他全局变量
21export const getLocaleId = () => {
22 if (__CLIENT__)
23 return window.__KOOT_LOCALEID__ || ''
24 if (__SERVER__) {
25 if (__DEV__)
26 return global.__KOOT_LOCALEID__
27 if (typeof __KOOT_LOCALEID__ === 'undefined')
28 return ''
29 return __KOOT_LOCALEID__ || ''
30 }
31}
32export const localeId = (() => getLocaleId())()
33
34export const getStore = () => {
35 if (__CLIENT__)
36 return window.__KOOT_STORE__
37 if (__SERVER__) {
38 if (__DEV__)
39 return global.__KOOT_STORE__
40 if (typeof __KOOT_STORE__ === 'undefined')
41 return ''
42 return __KOOT_STORE__
43 }
44}
45export const store = (() => getStore())()
46
47export const getHistory = () => {
48 if (__CLIENT__)
49 return window.__KOOT_HISTORY__
50 if (__SERVER__) {
51 if (__DEV__)
52 return global.__KOOT_HISTORY__
53 if (typeof __KOOT_HISTORY__ === 'undefined')
54 return ''
55 return __KOOT_HISTORY__
56 }
57}
58export const history = (() => getHistory())()