Skip to content

Commit f8a23af

Browse files
authored
Add Reactium.State global sync state object (#196)
1 parent 75bcae6 commit f8a23af

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

.core/app/reactium-hooks.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import _ from 'underscore';
44
import deps from 'dependencies';
55

66
import('reactium-core/sdk').then(
7-
async ({ default: Reactium, useHookComponent }) => {
7+
async ({ default: Reactium, ReactiumSyncState }) => {
88
Reactium.Hook.register(
99
'component-bindings',
1010
async context => {
@@ -121,6 +121,17 @@ import('reactium-core/sdk').then(
121121
Reactium.Enums.priority.highest,
122122
'REACTIUM_APP_BOOT_MESSAGE',
123123
);
124+
125+
Reactium.Hook.register(
126+
'sdk-init',
127+
async () => {
128+
Reactium.State = new ReactiumSyncState(
129+
op.get(window, 'state', {}),
130+
);
131+
},
132+
Reactium.Enums.priority.highest,
133+
'REACTIUM-STATE-INIT',
134+
);
124135
},
125136
);
126137

0 commit comments

Comments
 (0)