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