Provider.astro 401 Bytes
---

const { locals: { store, session } } = Astro

const getPreloadedState = async () => {
  //await getAllAsync(store.dispatch)
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve(store.getState())
    }, 0)
  })
}

---
<script define:vars={{preloadedState: await getPreloadedState()}}>
window.__PRELOADED_STATE__ = preloadedState
console.log('window', window)
</script>