// session.store.js
import { createRoot } from "solid-js"
import { createStore, reconcile } from "solid-js/store"
function sessionStore () {
const [session, setSession] = createStore({})
return {
session,
setSession,
fetchSession: () =>
fetch("/api/v1/session").
then(res => res.json()).
then(data => setSession(reconcile(data) /* crash starts here, on setSession*/)),
}
}
export default createRoot(sessionStore)
// session.store.js
import { createRoot } from "solid-js"
import { createStore, reconcile } from "solid-js/store"
function sessionStore () {
const [session, setSession] = createStore({})
return {
session,
setSession,
fetchSession: () =>
fetch("/api/v1/session").
then(res => res.json()).
then(data => setSession(reconcile(data) /* crash starts here, on setSession*/)),
}
}
export default createRoot(sessionStore)