title: why the google chrome extension setlocalstorage function did not work
body: <p>I write the set local storage function in a public lib, when I invoke this function in google chrome extension, the value did not set to local storage:</p>
  <pre><code>const LocalStorage = {
    setLocalStorage: async (key: string, value: string): Promise&lt;string&gt; =&gt; {
      return new Promise((resolve, reject) =&gt; {
        chrome.storage.local.set({
          key: value
        }, function () {
          resolve(&quot;&quot;);
        });
      });
    },
  }
  
  export default LocalStorage
  </code></pre>
  <p>I invoke this function like this to set the value:</p>
  <pre><code>await LocalStorage.setLocalStorage(&quot;key&quot;, &quot;value to set&quot;).then(() =&gt; {
          LocalStorage.readLocalStorage(&quot;key&quot;).then((result) =&gt; {
            alert(result);
          });
        });
  </code></pre>
  <p>but the result was '', did not show the value <code>value to set</code>, why this did not work. when I use this original function to set in context, it works:</p>
  <pre><code>chrome.storage.local.set({
          &quot;key&quot;:&quot;value to set&quot;
          },async function(){
           
        });
  </code></pre>