import Storage from 'react-native-storage' ; let obj = null ; if ( ! __SERVER__ && typeof window != 'undefined' ) { obj = new Storage ( { size : 1000 , storageBackend : window . localStorage , defaultExpires : null , enableCache : true , } ) ; } export default { save : ( data ) => { return new Promise ( resolve => { obj . save ( data ) . then ( ( res ) => { resolve ( res ) ; } ) . catch ( ( err ) => { resolve ( ) ; } ) ; } ) ; } , load : ( data ) => { return new Promise ( resolve => { obj . load ( data ) . then ( ( res ) => { resolve ( res ) ; } ) . catch ( ( err ) => { resolve ( ) ; } ) ; } ) ; } , remove : ( data ) => { obj . remove ( data ) ; } } ;