1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | import * as reduxForCreateStore from './React/redux'
|
12 | export { reduxForCreateStore }
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | export { default as extend } from "__KOOT_HOC_EXTEND__"
|
19 |
|
20 |
|
21 | export 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 | }
|
32 | export const resetLocaleId = () => localeId = getLocaleId()
|
33 | export let localeId = (() => getLocaleId())()
|
34 |
|
35 | export const getStore = () => {
|
36 | if (__CLIENT__)
|
37 | return window.__KOOT_STORE__
|
38 | if (__SERVER__) {
|
39 | if (__DEV__)
|
40 | return global.__KOOT_STORE__
|
41 | if (typeof __KOOT_STORE__ === 'undefined')
|
42 | return ''
|
43 | return __KOOT_STORE__
|
44 | }
|
45 | }
|
46 | export const resetStore = () => store = getStore()
|
47 | export let store = (() => getStore())()
|
48 |
|
49 | export const getHistory = () => {
|
50 | if (__CLIENT__)
|
51 | return window.__KOOT_HISTORY__
|
52 | if (__SERVER__) {
|
53 | if (__DEV__)
|
54 | return global.__KOOT_HISTORY__
|
55 | if (typeof __KOOT_HISTORY__ === 'undefined')
|
56 | return ''
|
57 | return __KOOT_HISTORY__
|
58 | }
|
59 | }
|
60 | export const resetHistory = () => history = getHistory()
|
61 | export let history = (() => getHistory())()
|
62 |
|
63 | if (__DEV__) {
|
64 | global.__KOOT_SSR_SET__ = v => {
|
65 | global.__KOOT_SSR__ = v
|
66 | }
|
67 | global.__KOOT_SSR_SET_LOCALEID__ = v => {
|
68 | global.__KOOT_LOCALEID__ = v
|
69 | localeId = v
|
70 | }
|
71 | global.__KOOT_SSR_SET_STORE__ = v => {
|
72 | global.__KOOT_STORE__ = v
|
73 | store = v
|
74 | }
|
75 | global.__KOOT_SSR_SET_HISTORY__ = v => {
|
76 | global.__KOOT_HISTORY__ = v
|
77 | history = v
|
78 | }
|
79 | }
|