Closed shaneing closed 7 years ago
getData(key) { let d; this.storage.get(key, (error, data) => { if (error) { err(`AutoComplete::getData(key) - Error for getting ${key}`); } d = data; }); return d; }
the content of storage file:
{}
But, an error occurred
I believe you figured it out already, but .get() is an async function, and therefore your getData function will return before that completes.
.get()
getData
the content of storage file:
But, an error occurred