class Storage { public static instance : Storage = new Storage ( ) ; param name param val example public SessionStorage ( name , val ) { const data = JSON . stringify ( val ) ; sessionStorage . setItem ( name , data ) ; } param name param val example public LocalStorage ( name , val ) { const data = JSON . stringify ( val ) ; localStorage . setItem ( name , data ) ; } params example public SessionStorageRemove ( name ) { if ( sessionStorage . getItem ( name ) ) { sessionStorage . removeItem ( name ) ; } } param name example public LocalStorageRemove ( name ) { if ( localStorage . getItem ( name ) ) { localStorage . removeItem ( name ) ; } } param name public GetSessionStorage ( name ) { return sessionStorage . getItem ( name ) ? sessionStorage . getItem ( name ) : null ; } public GetLocalStorage ( name ) { return localStorage . getItem ( name ) ? localStorage . getItem ( name ) : null ; } } export default Storage . instance ;