Closed elliott-with-the-longest-name-on-github closed 1 year ago
It would be super cool to have a hook in handleSession for setting the initial session state:
handleSession
const generateInitialState = () => { return { something: 'default' } } export const handle = handleSession({ init: generateInitialState });
This would enable us to make sure the shape of the object we're storing in sessiondata is always what we expect (and not "undefined")
Hey you can now set the initial session state with version 3.3.0
3.3.0
export const handle = handleSession({ init: (event) => ({ views: 0 }) });
❤️
It would be super cool to have a hook in
handleSession
for setting the initial session state:This would enable us to make sure the shape of the object we're storing in sessiondata is always what we expect (and not "undefined")