export function save ( key , obj ) { localStorage . setItem ( key , JSON . stringify ( typeof obj . toJS === 'function' ? obj . toJS ( ) : obj ) ) ; } export function get ( key ) { const str = localStorage . getItem ( key ) ; if ( ! str ) { return undefined ; } try { return JSON . parse ( str ) ; } catch ( err ) { return undefined ; } } export function remove ( item ) { localStorage . removeItem ( item ) ; }