Clojurians
# om

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

cjhowe 07:42:06

has anyone tried saving the om.next/app-state to local storage so you can load it as the initial state on refresh for offline support?

cjhowe 07:43:07

@cjhowe uploaded a file: Untitled and commented: i have something like this to initialize om from the old app-state or normalize the initial-state if it doesn't exist

cjhowe 07:45:03

for some reason it's not really re-initializing, does :normalize false disable normalization completely?

cjhowe 07:50:48

i mean, it's passing the idents into my components as their state, which is all wrong? oh, and i use om/db->tree in my parser

cjhowe 08:16:56

ah, i guess i can just denormalize it before saving it to local storage

levitanong 09:09:26

@cjhowe why aren’t you normalizing?

cjhowe 09:44:33

what i was doing was saving the normalized app state in local storage and trying to use it as initial state, so i tried to set :normalized false so it wouldn't normalize the (already normalized) initial state. that i guess disables normalization completely, but i do want normalization

cjhowe 09:44:43

just not for the initial state

cjhowe 09:45:41

for now i denormalize it each time it saves the app state to local storage so it can be used for the initial state, but i'd rather not

levitanong 12:54:46

@cjhowe ahh, I see. How are you merging to state? AFAIK you can override normalization when merging in if you pass an empty query

levitanong 12:55:08

(if you’re using om/merge! or the send cb)