From 75825436889c4c4a16495e65443baab624e1f4f0 Mon Sep 17 00:00:00 2001 From: John Dillick Date: Mon, 24 Apr 2023 16:13:01 -1000 Subject: [PATCH] Add Reactium.State global sync state object --- .core/app/reactium-hooks.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.core/app/reactium-hooks.js b/.core/app/reactium-hooks.js index 04860fa..02fb16b 100644 --- a/.core/app/reactium-hooks.js +++ b/.core/app/reactium-hooks.js @@ -4,7 +4,7 @@ import _ from 'underscore'; import deps from 'dependencies'; import('reactium-core/sdk').then( - async ({ default: Reactium, useHookComponent }) => { + async ({ default: Reactium, ReactiumSyncState }) => { Reactium.Hook.register( 'component-bindings', async context => { @@ -121,6 +121,17 @@ import('reactium-core/sdk').then( Reactium.Enums.priority.highest, 'REACTIUM_APP_BOOT_MESSAGE', ); + + Reactium.Hook.register( + 'sdk-init', + async () => { + Reactium.State = new ReactiumSyncState( + op.get(window, 'state', {}), + ); + }, + Reactium.Enums.priority.highest, + 'REACTIUM-STATE-INIT', + ); }, );