Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.getItem() called synchronously in README. Bug in example? #1075

Closed
blukis opened this issue Dec 20, 2022 · 1 comment
Closed

.getItem() called synchronously in README. Bug in example? #1075

blukis opened this issue Dec 20, 2022 · 1 comment

Comments

@blukis
Copy link

blukis commented Dec 20, 2022

In README.md, this line seems to be executing .getItem() synchronously. As getItem() requires an asynchronous or promise methods, is this a documentation bug?

...
return localforage.getItem('key');
...
@DiegoAWS
Copy link

Here localforage.getItem('key') is a Promise and it's correctly written in the documentation. The await or .then() clausule should be when calling the function wrapping this return.

You can read this for more on this topic.

@blukis blukis closed this as completed Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants