export const getCachedFormData = ( id ) => { if ( typeof localStorage === 'undefined' ) { return { } ; } return JSON . parse ( localStorage . getItem ( id ) || '{}' ) ; } ; export const setCachedFormData = ( id , data ) => { if ( typeof localStorage === 'undefined' ) { return ; } localStorage . setItem ( id , JSON . stringify ( data ) ) ; } ;