title: How to push multiple items into an array and load into async storage in react native?
body: <p>I am attempting to push data into local storage in react native, in this case push multiple elements. I am attempting to use documentation pointed out here:</p>
  
  <p><a href="https://stackoverflow.com/questions/52963308/how-do-i-set-multiple-values-within-asyncstorage">How do I set multiple values within Asyncstorage</a></p>
  
  <p>How would I go about doing this properly? Below is some code:</p>
  
  <p><strong>What I am currently doing</strong></p>
  
  <pre><code>const STORAGE_KEY = '@save_enableauto';
  const DBLTIME_KEY = '@save_dbltime';
  
      state={
          times: Times,
          messageTimes: {
              dblTime: '12:00 pm',
              genTime: '12:00 pm'
          }
          enableAuto:false
      }
  
  
      //retrieves automatic messaging status
      _retrieveData = async () =&gt; {
          try {
  
            //pull data from local storage
            const enableAuto = await AsyncStorage.getItem(STORAGE_KEY);
            const dblTime = await AsyncStorage.getItem(DBLTIME_KEY);
  
            console.log('auto messages set: ',enableAuto);
            console.log('time data is:', dblTime);
  
            //reset state for time if it exists in local storage
            if(dblTime !==null) {
              this.setState(prevState =&gt; ({
                  messageTimes: {                   // object that we want to update
                      ...prevState.messageTimes,    // keep all other key-value pairs
                      dblTime: dblTime       // update the value of specific key
                  }
              }))
            } 
  
            //reset state for notifications if exists in local storage 
            if (enableAuto !== null) {
              // We have data!!
              console.log('receiving from local storage: ',enableAuto);
              this.setState({ enableAuto:eval(enableAuto) });
            }
          } catch (error) {
              alert('failed to load previous settings.')
            // Error retrieving data
          }
      };
  
  //trying to set it up with one call
      _retrieveDataGroup = async () =&gt; {
  
          const items = JSON.stringify([['k1', STORAGE_KEY], ['k2', DBLTIME_KEY]]);
  
          try {
              const localData = AsyncStorage.multiGet(items, () =&gt; {
                  //to do something
              });
  
              console.log('Group fetch: ',localData);
  
          } catch (error) {
              alert('failed to load previous settings.')
            // Error retrieving data
          }
      };   
  </code></pre>
  
  <p>right now what I receive when console logging group fetching is a promise:</p>
  
  <pre><code>Group fetch:  Promise {
    "_40": 0,
    "_55": null,
    "_65": 0,
    "_72": null,
  }
  </code></pre>